passing cmds up from the VM, was pending mac vm 3.2.4

Lex Spoon lex at cc.gatech.edu
Tue Feb 19 23:02:09 UTC 2002


> > Now what interesting things can you do if you want to pass 
> > information upwards and you have 6 integers to work with? 
> 
> What you can (and should :-) do is to define one of these six ints as a
> flag saying "there are n message in the queue please call the
> appropriate primitive to retrieve the contents" and buffer everything in
> the VM. No need to abuse the event structure just to stick in something
> that it wasn't designed to deal with ;-)
> 

This sounds Very Cool. 

Now an issue that seems to have been ducked, is, what if the event wants
to wait for a response?  For example, you have hooked up Squeak to a GUI
toolkit, and your list widget is requesting the list of items to display
from Squeak.  What do you do?

Alternatively, suppose you want to implement a library in Squeak and let
it be callable from some other language.

Either way, in addition to signalling an event, it would be nice if:

	1. You could re-enter the interpreter.

	2. The event handler could call a "return from handler" primitive when
it is done, which will exit the recursive version of the interpreter.


An added complexity is if there are two event handlers in Squeak running
at the same time, and they return in the right order.  But the model
still works -- you just need to mark somewhere that one of them is
already done, when you go wait for the other one.


And of course, it would be nice if all of this was then wrapped up in a
nice easy-to-use package, but, one thing at a time.  :)


-Lex



More information about the Squeak-dev mailing list