[Anonymous primitives?] Re: [GOODIE] Delegation and Self like things for Squeak
Rob Withers
rwithers12 at mediaone.net
Thu Aug 23 05:32:51 UTC 2001
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?
- 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
|