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

Changing the :INITFORM of a slot with :ALLOCATION :CLASS



    Date: Tue, 19 Mar 91 18:37 PST
    From: Richard Lamson <rsl@MAX-FLEISCHER.SF.Dialnet.ILA.COM>

    subject.  However, another way to go with this is to have a method which
    returns the value you want for members of the class:

      (defmethod color ((thing elephant))
	'gray)

    Note that by changing this definition and recompiling, you get the result
    you want, namely that COLOR on any member of the class will return the new
    value.  This is unlikely to be slower than accessing a class-allocated
    slot in any CLOS, by the way.

Yes!  For the kind of "class parameters" I wanted, this simple solution
is the best I've seen.  I can't access the parameter via WITH-SLOTS, but
I could at least use WITH-ACCESSORS if I wanted.


	Lawrence G. Mayka
	AT&T Bell Laboratories
	lgm@iexist.att.com

Standard disclaimer.