Plug in primitive help

Jim Benson jb at
Thu Feb 11 18:42:02 UTC 1999

Thanks Tim.

Does this really mean that I need to return something? I assume that in the
simplest case, basically a no-op, I need to return the receiver on the
stack, making the example incorrect.

Put another way: Let's say that I am writing a primitive that I do not have
to return a value. You're saying in this case I have to return the receiver,
in other words, always returns self?


-----Original Message-----
From: Tim Rowledge <rowledge at>
To: Squeak <squeak at>
Date: Thursday, February 11, 1999 10:22 AM
Subject: Re: Plug in primitive help

>The basic rule is to
>a) if the primitive suceeds, pop all the arguments and the reciever, then
>the answer you want to return. Of course, if you intend to return the
>save time by not popping it !
>b) if the primitive fails, do not pop anything, call primitiveFail() and
>You have to take care to balance these things properly or as you have
>discovered, life can get unpleasant.  If you write your prims in a style
>you pop arguments as you go along, you will need to be particularly careful
>unpop the correct number if you fail part way through.
>Strange OpCodes: ESR: Emulate Slide Rule
>Tim Rowledge:  rowledge at (w)  +1 (650) 842-6110 (w)
> tim at (h)  <>

More information about the Squeak-dev mailing list