G
George Moschovitis
Hello everyone,
I found the following ruby idiom in "The Ruby Way":
x = 0
1.times {
x = 1
puts x
}
puts x
prints:
1
0
essentialy this trick creates a new scope. Is there a more elegant
way to do it?
George Moschovitis
ps: The Ruby Way is a very nice book!
I found the following ruby idiom in "The Ruby Way":
x = 0
1.times {
x = 1
puts x
}
puts x
prints:
1
0
essentialy this trick creates a new scope. Is there a more elegant
way to do it?
George Moschovitis
ps: The Ruby Way is a very nice book!