On Tue, Jul 23, 2013 at 2:02 AM, St�phane Ducasse
<stephane.ducasse@inria.fr> wrote:
thanks!
It makes a lot of sense.
I will play with another example because I want to really understand the outerContext of closure vs the home context.
The outerContext is a link in the static chain. �Each block is created inside some context. �This is the block's outerContext. �If the block is not nested then the outerCOntext will also be the home context �But if the block is nested inside another block activation, then the outerContext refers to that block activation, and the block activation's block's outerContext is the home context. �So there are as many outerContext steps as there are nesting levels.
| homeContext b1 |
homeContext := thisContext.
b1 := [| b2 |
� � � � � self assert: thisContext closure == b1.
� � � � � self assert: b1 outerContext == homeContext.
� � � � � b2 := [self assert: thisContext closure == b2.
� � � � � � � � � � self assert: b2 outerContext closure outerContext == homeContext].
� � � � � b2 value].
b1 value�
Ignore the "bN appears to be undefined at this point" and evaluate the above. �No assert fails.
Draw a picture.