[Anonymous primitives?] Re: [GOODIE] Delegation and Self like things for Squeak

Bob Arning arning at charm.net
Thu Aug 23 12:14:16 UTC 2001


On Thu, 23 Aug 2001 01:32:51 -0400 "Rob Withers" <rwithers12 at mediaone.net> wrote:
>Bob and Mark, I was thinking closest to what Mark posted I suppose, although
>I forgot to consider that you would have to declare the types in order to
>have multi-methods; I don't think that fits well in Smalltalk model
>(explicit types are bad - it binds early?), but couldn't it be type
>inferenced by usage?  However, the idea of using the compiler to create a
>BlockContext which is marked as a primitive is an interesting take.  As
>Stephen points out, we could setup the bytecodes by hand:
>    push the first arg as the receiver
>    push the second arg as the primitiveAdd arg
>    invoke the primitive
>    pop the stack
>
>Bob, in your suggestion, why would the stack be bloated?

I don't know that it would be, but I must admit that I don't clearly understand the problem and offered my suggestion simply to point out that a primitive could be invoked for any combination of receiver/arguments. Whether it solves the problem at hand I don't know.

Cheers,
Bob

>- Rob
>
>Bob Arning wrote:
>> Object>>primitive1ForAnyObject: as
>>
>> primitive1ForAnyObject: arg
>>
>> <primitive: 1>
>
>Mark van Gulik wrote:
>> b ::= [x:integer, y:integer |
>> Primitive 1;
>> Crash "It didn't work";  /* in case of failure */
>> ] : integer;
>> Print b(3,4);





More information about the Squeak-dev mailing list