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

John M McIntosh johnmci at smalltalkconsulting.com
Tue Feb 19 22:05:46 UTC 2002


>On Thursday, February 14, 2002, at 08:06 AM, John M McIntosh wrote:
>
>>>John M McIntosh <johnmci at smalltalkconsulting.com> is claimed by 
>>>the authorities to have written:
>>>
>>>>  To fix this the ability to send smalltalk commands upwards from the
>>>>  VM to be executed might be an interesting idea. This would require
>>>>  some agreement of how to setup the cmd in the VM and some smalltalk
>>>>  changes to trigger the action.
>>>One way I've done this in the past is to turn them into pseudo-events
>>>and pass them in via the event queue. Usually this is simple, effective
>>>and extensible. Worth checking out.
>>>
>>
>>Yes, that is what I'm proposing, but it seems comments on doing 
>>this are few. Must be the olympics.
>
>I've been wanting to do a variant of this for a while, but have so 
>far shied away from the event logic.  I dd accomplish my mission the 
>last time I was in there, but just barely made it back out again ;-)
>
>Anyway, the idea is to encode message sends to objects in the image 
>using events:  Maintain a table of objects and applicable messages 
>on the image side that are both mapped to integers and published 
>using primitives and an equivalent external mapping table (with 
>strings identifying both the objects and the messages).  An external 
>caller then just sends string-encoded messages to named objects, 
>with VM support code mapping that to a proper event structure.
>
>Marcel

Well ignoring David's comments/questions about why can't I stick 
something on a queue for the moment. I'll point out the event 
structure is this

typedef struct sqInputEvent {
	int type; /* type of event; either one of EventTypeXXX */
	unsigned int timeStamp; /* time stamp */
      /* the interpretation of the following fields depend on the type 
of the event */
	int unused1;
	int unused2;
	int unused3;
	int unused4;
	int unused5;
	int unused6;
} sqInputEvent;

Now what interesting things can you do if you want to pass 
information upwards and you have 6 integers to work with? Really of 
course I want to invoke method fum against object foo with perhaps 
some event driven data. My original thought was to build a character 
string and invoke the compiler, but I'm not sure where to stick such 
a string, and if for example allocating an object via 
instantiateClassindexableSize would be safe. (Mind that I could 
figure out by examining the code).

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list