thisContext question

C. Gable Watts CGableWatts at Mac.com
Sun Apr 28 15:07:27 UTC 2002


No, actually it's not because slots in the context have been nilled out.  It's because all 'doIt' expressions that you execute in a Workspace are compiled as a temporary method of nil (UndefinedObject).  The 'doIt' is compiled as a method of nil, executed, and then the method is deleted.

That is why the sender is nil, because the object that sent the message 'run' WAS the nil object.

You can see this more directly by evaluating in a workspace:
	thisContext receiver
and it will show you the receiver at the time the method is evaluating is nil (the UndefinedObject).


Carl Gable Watts
http://members.shaw.ca/Gable/professional.html


>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