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

:accessor v. :type ???



Is there something simple I'm missing here?


-------TRANSCRIPT HERE------------
(defclass foo () ((x :accessor foo-x)))  ;;; no type option here!
	NIL
(setq *foo* (make-instance 'foo))
	#<Standard-Instance 17543761>
(foo-x *foo*)
	NIL
(defclass foo () ((x :accessor foo-x :type symbol)))  ;;; redefine slot with
:type this time
	NIL
(setq *foo1* (make-instance 'foo))
	#<Standard-Instance 20040311>
(foo-x *foo1*)                         ;;; and now it can't find the accessor
Error: There are no methods on the generic-function #<Function .l.a5bdc57f @
#x3de651>,
so it is an error to call it.
----------END OF TRANSCRIPT--------

I tried various variations on the theme, such as ensuring the instance was
initialized with a value of the proper type, but the same pattern recurs.

Was ist los, hier?

David O. Nelson

ARPA:   daven@lll-crg.arpa      |
	     @crg.llnl.gov      |- whichever one works THIS week