Return values in primitives.

Ned Konz ned at squeakland.org
Mon Apr 4 22:35:28 UTC 2005


On Monday 04 April 2005 4:32 am, thimof at iutc3.unicaen.fr wrote:

> I'm making primitives in C plugins but I can't get why the value 5 is
> passed in to  the function popThenPush, in every sample code. Shall I
> always choose this very value or does it depend upon something else?

Assuming you're using popThenPush to return a value, you usually want to pop 
all the arguments plus the receiver, and then push your one value.

You'd only use 5 if the primitive had 4 arguments.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list