[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CLOS slot access
- To: Brad.Myers@a.gp.cs.cmu.edu
- Subject: Re: CLOS slot access
- From: hartung%ics@ucsd.edu (Jeff Hartung)
- Date: 29 Jun 88 10:05 PDT (Wednesday)
- Cc: commonloops.pa@Xerox.COM, bam@a.gp.cs.cmu.edu
- Redistributed: commonloops.pa
>What is the fastest way to do slot accesses in CLOS?
>We are using
> (defclass foo ()
> (slot1 :initform NIL)
> ....
> )
>(:accessor-prefix))
>(defmethod bar ((f foo))
> (clos::with-slots* (slot1) f
> (setf slot1 3) ; setting
> (+ 6 slot1) ; access
...
The latest CLOS specs no longer have an :accessor-prefix class-option and now
include :accessor as a slot option, as well as :reader, :writer and other slot
related stuff. Therefore, you would use:
(defclass foo ()
((slot1 :accessor slot1
:initform NIL)
...
))
(defmethod bar ((f foo))
...
--Jeff Hartung--
ARPA - hartung@sdics.ucsd.edu
UUCP - !ucsd!sdics!hartung