[GOODIE] Delegation and Self like things for Squeak

Mark van Gulik ghoul at attglobal.net
Wed Aug 22 21:06:40 UTC 2001


In Avail I don't distinguish between blocks and (multi)methods.  Thus, 
if you wanted to invoke primitive 1 (add two integers, no surprise 
there), you could use:

b ::= [x:integer, y:integer |
	Primitive 1;
	Crash "It didn't work";  /* in case of failure */
] : integer;
Print b(3,4);

The temporary variable b is not necessary, but improves the clarity of 
the example.


On Wednesday, August 22, 2001, at 02:39 am, Rob Withers wrote:

> oops.  I wrote:
>> Mirror would implement
>> ------
>> delegate: selector arguments: argArray
>>
>>     ^ self reflectee delegate: selector arguments: argArray
>> -----
>>
>
> but this doesn't do it.  I wanted to execute the delegate primitive, 
> without
> implementing #delegate:arguments: in the Forwarder (that may be 
> chained).
> Additionally, creating a mirror will slow it down.
>
> Is there a way to invoke a primitive against a different receiver, in
> Squeak?  For example, In a doIt, invoke <primitive: 1> and supply the 2
> numbers - one the receiver and the other the argument.
>
> - Rob
>
>
>




More information about the Squeak-dev mailing list