On Tue, Aug 01, 2006 at 02:05:17PM +0900, Just Another Victim of the Ambient Morality wrote: > [ snip ] > > I _think_ I know what a closure is, as long as Wikipedia and all Ruby > tutorials haven't conspired to lie to me. Again, it didn't occur to me show > you that they are closures. I was only trying to show you what will make a > closure... > So, are these closures, as you understand them? How is your > understanding different from mine? There was some stuff to digest there, and I'll be digesting it. As for what I didn't snip, I'll try explaining a closure (as I understand it) in different terms: There is a variable. There is a (something we'll call "lambda"). The lambda uses the variable. The variable is in a scope outside of the lambda's scope, but available to the lambda. The variable's original scope "closes", thus eliminating the variable for purposes of anything else in the program other than the lambda, thus "closing" the code in the lambda -- thus the term "closure". It produces circumstances that object oriented programmers would recognize as "protection" and "encapsulation". How does that mesh with your take on it? -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] This sig for rent: a Signify v1.14 production from http://www.debian.org/