[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with-accessors

> I presented the current state of CLOS to the people at MCC.  When I got
> to with-slots they said "hey thats biased against accessors".  We came
> up with the idea of with-accessors which is basically like the long form
> of with slots.  

> This use of with-accessors:

> (with-accessors ((x position-x)
>                  (y position-y))
>             >     p1
>   (setq x y))

> is equivalent to:

> (let ((#:g1 p1))
>   (setf (position-x #:g1) (position-y #:g1)))

> and is parallel to:

> (with-slots ((x x)
>              (y y))
>             p1
>   (setq x y))

> I think the MCC comment was good and captures a lot of the complaints I
> have heard about the new with-slots.  I think we should add
> with-accessors to the spec.

The sounds good.