[ENH] ifEmptyParam-md

David Farber dfarber at numenor.com
Sat Jan 31 18:19:43 UTC 2004


Ok, so Self's behavior is implicit-context-receiver not implicit-self or is there syntax for both?

david

At 12:25 PM 1/30/2004 -0800, you wrote:
>
>On Jan 30, 2004, at 12:06 PM, David Farber wrote:
>
>>
>> What is implict-context-receiver syntax?
>
>If no receiver is specified, it's assumed to be thisContext.
>Self uses this in two ways that I know of:
>
>- instead of assignment, temps are set through accessors on the current 
>MethodContext, eg,
>
>|x|
>x: 2.
>
>which is equivalent to
>
>|x|
>thisContext x: 2
>
>Squeak probably can't emulate that because having a separate 
>MethodContext class for each possible combination of args and temps 
>would be a little much.
>
>- return isn't special syntax, but is a binary method on MethodContext, 
>eg,
>
>foo: bar
>   ^ (bar + 1)
>
>is equivalent to
>
>foo: bar
>   thisContext ^ (bar + 1)
>
>Squeak could certainly do that, we already have MethodContext>>return:. 
>  But I'm not at all sure we'd want to.
>Note that those parens are required in Self, because of precedence.
>
>
>
--
David Farber
dfarber at numenor.com



More information about the Squeak-dev mailing list