From kamen at cybuild.com Mon Nov 6 12:43:15 2006 From: kamen at cybuild.com (Kamen TOMOV) Date: Mon, 06 Nov 2006 14:43:15 +0200 Subject: [bknr-devel] :read :update keywords meaning Message-ID: Hi, I tried to find in the documentation the meaning of the :read and :update slot options in define-persistent-class and I couldn't. Then I tried in the source and got lost :-) Could you please help? Thanks! -- Kamen From hans at huebner.org Mon Nov 6 14:55:25 2006 From: hans at huebner.org (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 6 Nov 2006 15:55:25 +0100 Subject: Fwd: [bknr-devel] :read :update keywords meaning In-Reply-To: References: Message-ID: (forgot to Cc to the list) ---------- Forwarded message ---------- From: Hans H?bner Date: 06.11.2006 14:24 Subject: Re: [bknr-devel] :read :update keywords meaning To: Kamen TOMOV Hi Kamen, :read means that a slot reader method is automatically defined, :update means that a reader and a writer method is defined. If you have a class (define-persistent-class foo () ((slot-a :read) (slot-b :update))) then macroexpanding this will yield: (defclass foo (store-object) ((slot-a :reader foo-slot-a :initarg :slot-a) (slot-b :accessor foo-slot-b :initarg :slot-b)) (:metaclass persistent-class)) Thus, :read gives you a :reader method whereas :update yields an :accessor. Both create a :initarg so that you can initialize the slots in a make-object. Note that nothing prevents you from writing to a :read slot using change-slot-values or setf. C-c C-m in slime macroexpands a s-expression, which is pretty handy. Cheers, -Hans 2006/11/6, Kamen TOMOV : > Hi, > > I tried to find in the documentation the meaning of the :read and > :update slot options in define-persistent-class and I couldn't. Then I > tried in the source and got lost :-) > > Could you please help? Thanks! > > -- > Kamen > _______________________________________________ > bknr-devel mailing list > bknr-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel >