Plug in primitive help

Tim Rowledge rowledge at interval.com
Thu Feb 11 19:27:23 UTC 1999


On Thu 11 Feb, Jim Benson wrote:
 
> 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?
Yes, I think you've got the right mental model now. The 'no-fault' default is
to return self, just like for normal methods.
Take a look at Interpreter>primitiveBeep and Interpreter>primitiveInputWord for
two quite simple examples of the difference.  #primitiveBitOr shows another way
of looking at it.

tim

-- 
Useful random insult:- If you give him a penny for his thoughts, you get change
back.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list