[Vm-dev] Return a value from the image to the VM

Rob Rothwell r.j.rothwell at gmail.com
Sun Nov 22 13:12:43 UTC 2009

> On 22.11.2009, at 05:07, Rob Rothwell wrote:
> > Hello...
> >
> > For scripting purposes, I just want to be able to do something like:
> >
> > SmalltalkImage current quit: errorCode.
> >
> > So that in the VM I can essentially do:
> >
> > return errorCode.
> >
> > at the end of sqMain?
> >
> > Any pointers on how to push a value BACK to the VM?  I have only barely
> dabbled with adding some custom menu commands to the VM long ago, and have
> no idea where to start.
> You would need to add a primitive to set the errorCode. This would be
> stored in an interpreter variable. Then the VM's exit code would be modified
> to retrieve that value.

So, unlike all the other examples out there, this would probably be best if
it were NOT an external plugin?  Would you be able to use VMMaker to do this
(I've never done that before), or just go hand code some stuff?

Do you think this seems like a generically pretty useful think to add to the
VM?  If so, I suppose I would like to do it right!

I hacked a temporary solution together with batch files and unique file
names, but it feels a little sloppy.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20091122/054dee11/attachment.htm

More information about the Vm-dev mailing list