[Vm-dev] How to return an array in a primitive ?

Mariano Martinez Peck marianopeck at gmail.com
Tue Apr 27 09:27:54 UTC 2010


Hi folks. I am writing some primitives in Interpreter and now I need to
return more than one value. Of course, in a OOP the ideal would be to return
an object that represents the result. That object would also have all the
instance variables I want.

So..first question, is it possible to create and push on the stack an object
of my own class ?   If true, con can I do it ?

now...suppose I cannot do that, the other option is to create an array with
the values I want to return, and then return the array. For this particular
case, I have 3 or 4 interegers I would like to put in the array, and push it
in the stack. Is this possible ?  If true, how ?

Are there other options for what I need ?

Thanks in advance for any help.

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100427/8b70bc65/attachment.htm


More information about the Vm-dev mailing list