Conundrum, sample of UTF-8 in Ruby 1.9.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# conundrum.rb | |
alias :λ :lambda | |
alias :Ω :abort | |
module Enumerable | |
alias :⇔ :collect | |
alias :∉ :reject | |
alias :∈ :select | |
alias :∫ :inject | |
alias :∀ :all? | |
alias :∃ :any? | |
end | |
class Array | |
alias :× :each | |
alias :⊠ :each_index | |
alias :≡ :eql? | |
alias :∋ :include? | |
alias :∪ :| | |
alias :∩ :& | |
end | |
%w(a b c).× do |letter| puts letter; end | |
%w(a b c).∪ %w(x y z) do |letter| puts letter; end | |
%w(a b c).∩ %w(c y z) do |letter| puts letter; end | |
a = λ {|s| puts s} | |
a.call('test') | |
Ω "It is the end" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment