[GOODIE] Delegation and Self like things for Squeak

Bob Arning arning at charm.net
Wed Aug 22 12:42:26 UTC 2001


On Wed, 22 Aug 2001 08:00:26 -0400 "Stephen Pair" <spair at advantive.com> wrote:
>Ha!  I never realized that would work!...I just assumed the primitive
>would fail.  

It might well do that. Many primitives require specific classes of objects on the stack and this example would permit you to invoke primitive #1 on something for which it was inappropriate.

>The caller might not appreciate what you've done to their
>stack though.

?? Why should the caller care? He called you. You invoked prim 1 on something. You returned a result. The caller has his answer.

Cheers,
Bob

>
>- Stephen
>
>> -----Original Message-----
>> From: squeak-dev-admin at lists.squeakfoundation.org 
>> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
>> Behalf Of Bob Arning
>> Sent: Wednesday, August 22, 2001 7:25 AM
>> To: rwithers12 at mediaone.net; squeak-dev at lists.squeakfoundation.org
>> Subject: Re: [GOODIE] Delegation and Self like things for Squeak
>> 
>> 
>> On Wed, 22 Aug 2001 03:39:54 -0400 "Rob Withers" 
>> <rwithers12 at mediaone.net> wrote:
>> >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.
>> 
>> Well, (he says while taking cover under his desk) you could 
>> just define
>> 
>> Object>>primitive1ForAnyObject: as
>> 
>> primitive1ForAnyObject: arg
>> 
>> 	<primitive: 1>





More information about the Squeak-dev mailing list