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

Defining Funcallable Classes in Genera's CLOS



Has anyone been successful in defining CLOS classes that
implement funcallable instances?  Genera does have a
CLOS:FUNCALLABLE-STANDARD-CLASS metaclass, but there does
not seem to be a way to set the function of instances of
a subclass.

I am trying to do the following:

(defclass STATEMENTS ()
    ((form		:INITARG :Form		:READER Form))
  (:METACLASS CLOS:FUNCALLABLE-STANDARD-CLASS))
(defun Make-a-Statement (form)
    (make-instance 'STATEMENTS :FORM form))

where instances of these statements have "forms" that are
in a special language and are compiled into a Lisp function
with one argument, called the context.  I would like to
be able to call the statement like so:

(defvar variable.assignment.example (Make-a-Statement "x <- 47"))
(defvar example.context (Make-a-Context '(x . NIL)))
(funcall variable.assignment.example example.context)

-Bryan

/-------------------------------------------------/
/  Bryan D. Basham				  /
/  NASA/JSC  Mail Stop: ER22,  Houston TX  77058  /
/  (713) 483-2065				  /
/  Basham@AIO.JSC.NASA.GOV			  /
/-------------------------------------------------/