[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Microcode changes for message-passing



Please comment on the following changes.  If they are thought to
be useful for cleaning up the message-passing stuff, I will put them in.

1. Make calling of an Instance or an Entity bind %SELF.  This eliminates
   the need for the <- function.  This could be a macro that turns into
   a funcall, but personally I prefer the function syntax
   (message x y) over (<- x ':message y).  (And why should all messages
   be in the user package, as opposed to the package where they "logically"
   belong?)

2. Define the following protocol for use of Instances.  Slot 0 of an
   Instance always contains its Class, which is also an Instance.  Slot 1
   of a Class contains the method-table for Instances of that Class.  Slot 2
   of a Class contains general information, probably as a property list,
   including variable-names needed by the interpreter in order to call
   a method written in interpreted Lisp (if we allow that).
   If the flag-bit of slot 0 of an Instance is 1, Slot 1 of that instance
   contains an auxiliary method table which is searched before the
   Class's method table.  This allows a class to have "options" at instance-
   creation time which are represented by slight alterations to certain
   methods, without the need to define a plethora of classes for
   each combination of options.  Note that in cases where "multiple
   superclasses" are the right thing, those instance-variables
   not in all superclasses would need to be represented as closures
   in the method table rather than as instance slots.

3. Add new misc functions GET-INSTANCE-SLOT-{1..17,N} and
   PUT-INSTANCE-SLOT-{1..17,N} which allow access to slots of the
   instance designated by %SELF.  The compiler will need to be modified
   to know about a new class of variables, in addition to Special and
   Local, which are represented as Instance slots.  These need not
   appear in the ADL.
   Eventually it will be recognized that Instances are just a type
   of detached lexical contour, and whatever variable-addressing mechanism
   is invented for Scheme can also be used for Instances.