Class MosKey provides part of the Muq support for the Muq Object System model of object-oriented computation. It is an internal support class normally only directly visible to -- or of interest to -- programmers venturing deep into the internals of Muq compilers and runtimes.
The MOS model requires that
eqto the original.
Muq meets these requirements by implementing MOS generic functions as normal compiledFunction instances which happen to have (among other things) a special bit set identifying them as a MOS compiledFunction, and to have in their first constant slot a pointer to a MosKey instance, which then contains the time-varying information such as the currently-defined set of methods for the generic function.
A MosKey instance is itself neither a function nor a compiledFunction: It is merely a passive datastructure containing information about the generic function encoded for quick access during method invocation ("message-sending").
Class MosKey adds the following properties to those of Class Plain:
( Buggo, should merge type and layout, I think: ) $S.abstract Normally NIL; non-NIL to forbid creation of instances. $S.type 'vector 'list or nil $S.layout Ram layout: :structure :vector :built-in :fixnum ... $S.compiler Parallel to function$s.compiler $S.documentation Value supplied to ]defclass :documentation option. $S.source Parallel to function$s.source $S.fileName Parallel to function$s.fileName $S.fnLine Parallel to function$s.fnLine $S.assertion Type verification compiledFunction. $S.predicate Type check compiled-funciton. $S.printFunction Print function. $S.createdAnInstance NIL unless an instances has been created. $S.mosClass Backpointer to MOS class we implement. $S.newerKey NIL, else pointer to key superceding us. $S.concName Prefix for accessor functions. $S.constructor Constructor compiledFunction. $S.copier Copier compiledFunction. $S.named t or nil $S.initialOffset whole number $S.export NIL unless defstruct included :export t option. $S.fertile NIL unless subclassing by other users is ok. $S.unsharedSlots # of unshared slots (those stored in key). $S.sharedSlots # of shared slots (those stored in instances). $S.mosParents # of direct superclasses. $S.mosAncestors # of direct and indirect superclasses. $S.initargs # of initarg -> slotname map pairs. $S.objectMmethods # of methods keying on obj of our class in 1st arg. $S.classMethods # of methods keying on our class in 1st arg. $S.metaclass Currently always standardClass.
Note: For convenience, the $S properties are also available in the public (default) propdir.
MosKey instances also contain internal arrays with the above dimensions, in particular, the class precedence list: See section getMosKeyInitarg. See section getMosKeyInitarg. See section getMosKeyParent. See section setMosKeyParent. See section getMosKeyAncestor. See section setMosKeyAncestor. See section getMosKeySlotProperty. See section setMosKeySlotProperty.
See section makeMosKey.
Go to the first, previous, next, last section, table of contents.