Hi everyone,
My question is about the semantics of block closures in squeak. I played around with scheme a bit in order to do some comparisons and one big question I have is how to alter the outer environment from a closure.
An example of closure semantics given by Ian Piumarta on squeak-dev in 1999 is as follows.
mkCounter := [:init ¦ [init := init + 1]].
b1 := mkCounter value: 42.
b1 value. 43
b1 value. 44
I never get 44 returned from the current squeak trunk. I only ever get 43, which suggests to me that the assignment to init in the inner block is not actually ever over writing the init value in the outer environment. How would I go about altering the outer environment from inside a block if I desired to do so?
Thanks for all your help,
Jeff G.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners