thisContext question

Joern Eyrich Joern.Eyrich at syngenio.de
Sun Apr 28 14:30:51 UTC 2002


Hi Alexande,

cool question.

I think it's like this:
You are looking at the context after it has been returned from.
In the process of returning, the sender and ip slots of the context are nilled out, see

"
Interpreter>>returnValue:to:

    ...
    "zap exited contexts so any future attempted use will be caught"
    self storePointerUnchecked: SenderIndex ofObject: thisCntx withValue: nilOop.
    ...
"

If you use
"
Test class>>run
	^ thisContext sender
"
instead you will get the sender context back from executing "Test run" in a workspace; of course, this also has already been returned from by then

Joern

Bergel Alexandre wrote:
> 
> Hello,
> 
> Let assume I have :
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Test class>>run
>         ^thisContext
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> And if I perform, from a workspace : Test run sender
> I get nil.
> 
> Why ?
> 
> Regards,
> Alexandre
> 
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._
> Bergel Alexandre  http://www.iam.unibe.ch/~bergel
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^



More information about the Squeak-dev mailing list