>>>>> "Alex" == Alex Schenkman <a...@schenkman.info> writes:
Alex> What does this mean? Alex> A closure is a block, right? And Squeak has already blocks... A closure is a block but not all blocks are closures. With classic smalltalk 80 and Squeak: a := (1 to: 10) do: [:n | [n]]. b := a collect: [:each | each value]. b will have something like #(10 10 10 10 ...). The problem is that the :n in each block ([n]) is shared as one variable. In a true closure, which modern Squeak and Pharo provide, we get the proper #(1 2 3 4 ... 10). That's because each apperance of "n" is "closed" with respect to the newly created block. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners