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

CLOS bug?



  This bug is biting me bad. Maybe someone already has a workaround?
Or maybe I'm losing my mind?

;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-

;;  The applicable method seems to depend on order of definition, for
;; standard reader methods versus default methods.  Compile these
;; defmethod/defclass forms and evaluate the other forms, in order, and
;; see what you get.

#||
In Symbolics 3650 CLOS in Genera 8.0, Logical Pathnames Translation Files NEWEST,
IP-TCP 422.2, Window Edit 8.2, microcode 3650-FPA-MIC 430, FEP 206,
FEP0:>g206-lisp.flod(21), FEP0:>g206-loaders.flod(21),
FEP0:>g206-tests.flod(21), FEP0:>g206-debug.flod(8), FEP0:>g206-info.flod(21),
1067x748 B&W Screen, Machine serial number 30352,
Unix Pathname completion (from FW:FW;COMPLETE.LISP.9),
world booted from FEP0:>Inc-TCP-on-Genera-8-0.load.1 on Symbolics 3650 #30352 (Pierre Cartan):
||#

(clos:defmethod ZOOT-NAME (object)
  object)

(clos:defclass ZOOT () ((name :reader zoot-name :initarg :name)))

(setq zoot (clos:make-instance 'zoot :name "ZOOT-1"))

;; This evaluates (incorrectly) to #<ZOOT 12345>
(zoot-name zoot)


;; Now compile the default method again.
(clos:defmethod ZOOT-NAME (object)
  object)

;; Now this evaluates (correctly) to "ZOOT-1"
(zoot-name zoot)