On 10.04.2009, at 05:48, Randal L. Schwartz wrote:

"K" == K K Subramaniam <subb...@gmail.com> writes:

K> In Squeak, i in the block will refer to the i in the do: block and the last
K> statement will print 25 because i would be 5 when do: terminates.

Not necessarily. I could see an implementation where i would be 4.


And how exactly does that statement help a beginner to understand the distinction between a BlockContext and a BlockClosure? ;)

Andrey: Both are pretty much the same, there is no change in syntax. Closures simply are Blocks Done Right.

Try to run the example Subbu mentioned, and see if you would have expected the result or not. With closures it does what one would expect.

- Bert -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to