[pro] When to use SLOT-VALUE...
Scott L. Burson
Scott at sympoiesis.com
Tue Nov 16 20:58:20 UTC 2010
On Tue, Nov 16, 2010 at 2:22 AM, Pascal Costanza <pc at p-cos.net> wrote:
>
> Note that it is always possible to have several accessors with different
> names. So you could define something like this:
>
> (defclass foo ()
> ((some-slot :reader official-slot-reader :accessor
> %internal-slot-accessor) ...))
>
>
I like this, actually, because it warns the reader that although the slot is
not to be written by clients, it may nonetheless change; the client mustn't
assume it's constant. Personally I think this is better than using
SLOT-VALUE, unless the only time it's written is for initialization.
-- Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20101116/fc6452be/attachment.html>
More information about the pro
mailing list