[Newbies] Block and Closure

Andrey Larionov 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
>> 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 at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


More information about the Beginners mailing list