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

objects, and evalhook query



I'm having a bit of trouble understanding objects.  For example,
suppose I want to define an array object such that a function
make-array returns a new instance of an array.  I want to initialize
that object by setting a "contents" instance variable to a vector of
the right size, and a "dims" instance variable to the dimensions,
something like this:

(define (make-array contents dims)
    (object nil
	((array? self) t)
	((aref self subs) (vref contents (...
	(((setter aref) self subs new) 
	    (set (vref contents (...
    )
)

(define-predicate array?)
(define-settable-operation (aref array subs))

but I don't seem to get any chance to initialize the "instance
variables" contents and dims; there is no equivalent to the NEW
method in Smalltalk.  Or have I just missed it?

On a totally different topic, is there some equivalent to the evalhook
feature of various Lisps in T?

	- Mike