S
Sam Kong
Hello!
I read an interview article with matz about closure.
(http://www.artima.com/intv/closures2.html)
He mentioned that Ruby's closure is a real closure like Lisp.
Local variables are shared between a method and a closure.
<snip>
local variables are shared between the closure and the method. It's a
real closure. It's not just a copy.
....
Yes, and that sharing allows you to do some interesting code demos, but
I think it's not that useful in the daily lives of programmers. It
doesn't matter that much. The plain copy, like it's done in Java's
inner classes for example, works in most cases. But in Ruby closures, I
wanted to respect the Lisp culture
</snip>
Can somebody help me understand what he meant?
Closures in other languages are different from Ruby?
And if possible, I want to see the *interesting code demos".
Thanks.
Sam
I read an interview article with matz about closure.
(http://www.artima.com/intv/closures2.html)
He mentioned that Ruby's closure is a real closure like Lisp.
Local variables are shared between a method and a closure.
<snip>
local variables are shared between the closure and the method. It's a
real closure. It's not just a copy.
....
Yes, and that sharing allows you to do some interesting code demos, but
I think it's not that useful in the daily lives of programmers. It
doesn't matter that much. The plain copy, like it's done in Java's
inner classes for example, works in most cases. But in Ruby closures, I
wanted to respect the Lisp culture
</snip>
Can somebody help me understand what he meant?
Closures in other languages are different from Ruby?
And if possible, I want to see the *interesting code demos".
Thanks.
Sam