[self-interest] Re: event system
Jecel Assumpcao Jr
jecel at lsi.usp.br
Thu Apr 8 21:08:10 UTC 1999
> > ["aClass allInstances" in Self?]
> I was referring to easily controlling/changing a single feature of a related
> group of related instances without a lot of leg work. Essentially, how do
> we factor behavior and structure in Self?
Oh. If you structure your objects so that the common behavior is
in shared parents (traits), then you can change the parents and
affect all the children at once. You get the advantages of class
based languages in Self by arranging objects as if they had classes.
While the language itself doesn't help with sharing structure, the
programming environment implements something called "copydown slots".
They are a bit awkward, but get the job done.
> Speaking of converting to C, someone is now working on a similar idea but
> with Objective-C. That's better, but I would still rather have just one
I like Objective-C, but don't see what advantage it has as a target
for translation from Smalltalk. The message passing overhead is
still a problem.
> > [keyboard example and merging events]
> When you merge the events into a single queue, I suppose they are somehow
> tagged as belonging to different keyboards. Yes?
No - the idea is exactly to avoid this. If you want text and don't
care where it came from, then you take it from the output of the
TextMux object. If you do want to know where it came from, just get
your input from the *inputs* of the TextMux object (either the
ps2Keyboard or internalKeyboard objects, or both).
> Thanks for the low-level mechanical details, but what then is the graph for?
> Why not just use a collection of queues for various devices generating and
> accepting streams of data?
That is hard to answer without drawing a picture. But imagine an
object that takes in cursor movement events and generate text (a
handwriting recognizer). We could connect its output into the TextMux
object mentioned above and all applications which get their input
from TextMux will automatically have handwriting recognition. And
depending on some control panel, the input for this object could
come from the mouse, from the pen+touch sensitive screen or even
from gersture recognition system attached to a video input.
Another example - you might want to connect a scanToMidi object to
the same input as the internalKeyboard object. Just a few more
connections and you can play a musical instrument by typing!
eGroup home: http://www.eGroups.com/list/self-interest
Free Web-based e-mail groups by eGroups.com
More information about the Self-interest