Ruby 1.9 and unicode

Well i tried to play a little with new unicode features.

i wanted to do something like this:

def Σ(*args)
args.inject(0){|sum,el| sum+el}
end

and use it like Σ[1,2,3,4]

BUT:

[email protected]:~$ irb1.9
irb(main):001:0> # -- encoding: utf-8 --
irb(main):002:0* Σ(1,2,3)
=> nil
[email protected]:~$


[email protected]:~$ irb1.9
irb(main):001:0> def Σ(*args)
SyntaxError: compile error
(irb):1: syntax error, unexpected $end
from (irb):1:in `Kernel#binding’
[email protected]:~$


as you can see it’s droping back to shell after i type unicode character
in.

I’m using Debian etch. Gnome + gnome terminal.

Any ideas?

Marcin R. wrote:

Well i tried to play a little with new unicode features.

i wanted to do something like this:

Any ideas?

I try with netbeans and from command in windows: it works!
But not with irb.

You ca try with a script and run the script with ruby interpreter

tiziano

Tiziano M. wrote:

You ca try with a script and run the script with ruby interpreter

tiziano

Strange, anyone can confirm that behavior? mayby some compiler flags ?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs