IRB UTF-8, script (/tmp/utf_test.rb).
"λ" :
λ = 'foo'
puts λ
> ruby -KU /tmp/utf_test.rb
foo
"λ" :
Kernel.class_eval do
alias_method :λ, :lambda
end
(λ { puts 'hi' }).call
> ruby -KU /tmp/utf_test.rb:
hi
:
Object.const_set :λ, 'bar'
> ruby -KU /tmp/utf_test.rb:
utf_test.rb:2:in `const_set': wrong constant name λ (NameError)
:
Object.const_set :Λ, 'bar'
> ruby -KU /tmp/utf_test.rb:
utf_test.rb:2:in `const_set': wrong constant name Λ (NameError)
, ASCII ( /^[A-Z]/).