[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] firstArg - why not valid for all objects?



No, a <! b compiles as a math operation. (I thought the same, but it
didn't work in testing.)

{ a <! b }.def.dumpByteCodes

BYTECODES: (6)
  0   12       PushInstVar 'a'
  1   13       PushInstVar 'b'
  2   B0       TailCallReturnFromFunction
  3   0E 2E    SendSpecialBinaryArithMsgX '<!'
  5   F2       BlockReturn

SendSpecialBinaryArithMsgX throws an error if the type is not suitable
for math. So the compiler would also have to be changed to stop
parsing <! as a binary math operator.

hjh

On Tue, Feb 26, 2008 at 5:22 PM, Julian Rohrhuber
<rohrhuber@xxxxxxxxxxxxxx> wrote:
> So all that is needed is:
>
>  + Object {
>         firstArg { arg that; ^this }
> }

-- 
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman