[elephant-devel] with-slots in SBCL 0.9.7
Tayssir John Gabbour
tjg-lisp at pentaside.org
Fri Feb 17 14:23:56 UTC 2006
William Halliburton wrote:
> with-slots does not seem to work for a persistent-metaclass object.
> I get
>
> When attempting to read the slot's value (slot-value), the slot
> DATE is missing
> from the object #<BLOG-ENTRY {93D28E1}>.
> [Condition of type SIMPLE-ERROR]
>
> I can use accessors, but would rather use with-slots.
Hi,
Hmm, on my SBCL 0.99 (on Darwin/PPC) WITH-SLOTS works fine. Could you
reproduce it in a small form like the following?
(defclass my-simple-test-class ()
((slot1 :accessor slot1 :initarg :slot1 :initform 10))
(:metaclass persistent-metaclass))
(defmethod print-object ((o my-simple-test-class) s)
(with-slots (slot1)
o
(print-unreadable-object (o s :type t :identity t)
(format s "~S:~S" 'slot1 slot1))))
Now at the REPL:
CL-USER> (add-to-root "elephant-devel"
(make-instance 'my-simple-test-class :slot1 20))
#<MY-SIMPLE-TEST-CLASS SLOT1:20 {10E822D1}>
CL-USER> (with-slots (slot1)
(get-from-root "elephant-devel")
slot1)
20
Tayssir
More information about the elephant-devel
mailing list