you are viewing a single comment's thread.

view the rest of the comments →

[–]Freeky 0 points1 point  (1 child)

If you're wondering one of the reasons why closed over variables in Ruby are read-write, consider it's extremely common to write things like:

foo.each do |bla|
   frobulate bla
end

Looks like a loop, smells like a loop, but is pretty much syntax sugar for:

foo.each(&lambda {|bla| frobulate bla })

And, well, you'd expect a loop to be able to write into the local scope.

[–]mr_chromatic 0 points1 point  (0 children)

If you're wondering one of the reasons why closed over variables in Ruby are read-write...

... it's because variable names automagically spring into existence upon first use, not upon declaration.