[Newbies] Block and Closure
anlarionov at gmail.com
Fri Apr 10 11:11:54 UTC 2009
Thanks. I'l try to experiment with this example
On Fri, Apr 10, 2009 at 11:54, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On 10.04.2009, at 05:48, Randal L. Schwartz wrote:
>>>>>>> "K" == K K Subramaniam <subbukk at gmail.com> writes:
>> K> In Squeak, i in the block will refer to the i in the do: block and the
>> 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 at lists.squeakfoundation.org
More information about the Beginners