Return values in primitives.

Alain Fischer mailinglist.fischer at bluewin.ch
Mon Apr 4 12:46:26 UTC 2005


If I remember well, the value depend of the number of paramater in your 
primitive.
If this is a unary message, you must use 1.
If you have the following message "messageWith:with:", you must use 3.

Before the primitive is called the argument are pushed on the stack,
first the sender and after the arguments.
When you return, you must pop all these argument and push your return 
value.

Hope this help you.
Alain.


On Apr 04, 2005, at 13:32PM, thimof at iutc3.unicaen.fr wrote:

>
>
> Hi.
> 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?
>
> Thanks in advance.
>




More information about the Squeak-dev mailing list