Re: A question on macro syntax choice (general CL style qn)

"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Wed, 8 Apr 2026 13:28:39 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Incidentally the reason for (object class) is you can say things like (foo particle-vector :rank 1) which can dramatically improve performance (aref does a lot better if it knows the rank of tje array in LW, for instance), and I didn't want this to be tangled up with slot specifications.  Class is needed so the macro can look up its
layout at compile time & hence turn slot references into arefs.

--tim

> On 8 Apr 2026, at 12:46, Tim Bradshaw (as tfb at tfeb dot org) <[email protected]> wrote:
> 
> I have a macro called with-array-slots.
> 
> Currently it looks like
> 
> (with-array-slots ((object class ...) slot-spec ...)
>  ...)
> 
> it has a multiple-object version which then looks like
> 
> (with-array-slots* (((object class ...) slot-spec ...) ((object class ...) ...) ...)
>  ...)
> 
> would it be better is the single-object version looked more like (say) with-slots:
> 
> (with-array-slots (slot-spec ...) (object class ...)
>  ...)
> 
> It seems to me it might be, but then the multiple-object one looks very different (even if I change the ordering).
> 
> You could argue that the multiple-object version serves no purpose.   It does serve some, because it can minimise the number of checks for incompatible class redefinition.  But perhaps the answer is to do away with it and make the single-object one look more like with-slots?
> 
> --tim
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> [email protected]
> http://www.lispworks.com/support/lisp-hug.html

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html