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

metaobject protocol (description languages)

   At RISC Linz we are currently evaluating PCL as a basis for our symbolic
   computation library. An important issue in this field are parameterized types
   - families of classes - such as zmod N, polynomial over A-FIELD in VARS,
   matrix DIMS of DOMAIN,... , where N, A-FIELD, VARS, DIMS, and DOMAIN are
   parameters for type zmod, polynomial, and matrix.
   We would like something like (DEFCLASS (ZMOD N) ...) and
   (DEFMETHOD xxx ((Z (ZMOD N))... )... ).

Given the ability to make reasonably general user-definable
specializers, you could fake parametrized types, by putting
the parametrization info into a slot, and defining a specializer
type which dispatched on that slot's value.  Something like this:
	(DEFCLASS ZMOD ((N) ...) ...)
	    ((N :KEY #'(LAMBDA (X) (SLOT-VALUE X 'N))))
	  (:SUPER (ZMOD)))
	(DEFMETHOD # ((Z (ZMOD N)) ...) ...)

The fictitious DEFDESCRIPTION form would give meaning to specializers
of the form (ZMOD #).  The effect would be to enrich the standard
"description language" of specializers, which consists only of
class names and EQL constructs.  A certain amount of structure
is needed to relate new descriptions to the existing ones;
this has been discussed in previous messages from me.

I believe that many uses of the meta class protocol will center
around the extension of the specializer syntax and semantics
(hence, of the generic function dispatch mechanisms), rather
than around finding new ways to implement slotted structures.

				-- John