[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
with-slots bug in xerox pcl
- To: commonloops.pa@Xerox.COM
- Subject: with-slots bug in xerox pcl
- From: fritzson@bigburd.PRC.Unisys.COM (Richard Fritzson)
- Date: 19 Aug 87 06:49 EDT (Wednesday)
- Cc: fritzson@bigburd.prc.unisys.com
- Redistributed: commonloops.pa
Now matter what I try, I can't get with-slots WITH use-accessors = T
to behave differently than with-slots WITH use-accessors = NIL.
I am using the Xerox Lyric version of PCL of 5/22/87 (rev 2), with the
official Lyric release of Xerox Common Lisp.
(defclass point ()
((xcoord :initform 0 :type number)
(ycoord :initform 0 :type number))
(:accessor-prefix point-)
)
(setf foo (make-instance 'point))
(setf (point-xcoord foo) 10)
; Redefine point-xcoord to see whether it is used or not
(defmethod point-xcoord ((p point))
(progn (print 'foo)(slot-value foo 'xcoord)))
; Now the accessor will also print "FOO"
; Define two methods, using with-slots
(defmethod test-getx-1((p point))
(with-slots ((p :use-accessor T)) xcoord))
(defmethod test-getx-2((p point))
(with-slots ((p :use-accessor ())) xcoord))
; But when we use them, they both use the accessor function,
; i.e. they both print "FOO" when executed.
(test-getx-1 foo)
(test-getx-2 foo)