[ENH] ifEmptyParam-md

Avi Bryant avi at beta4.com
Fri Jan 30 20:25:03 UTC 2004


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.




More information about the Squeak-dev mailing list