Lexicographical access to arrays John Cowan (09 Apr 2026 18:59 UTC)
Re: Lexicographical access to arrays Per Bothner (09 Apr 2026 19:47 UTC)
Re: Lexicographical access to arrays Alex Shinn (09 Apr 2026 23:48 UTC)
Re: Lexicographical access to arrays Bradley Lucier (10 Apr 2026 00:22 UTC)
Re: Lexicographical access to arrays Per Bothner (10 Apr 2026 01:48 UTC)
Re: Lexicographical access to arrays John Cowan (10 Apr 2026 05:52 UTC)
Re: Lexicographical access to arrays Bradley Lucier (10 Apr 2026 15:33 UTC)
Re: Lexicographical access to arrays Bradley Lucier (10 Apr 2026 15:36 UTC)
Re: Lexicographical access to arrays Bradley Lucier (11 Apr 2026 00:32 UTC)
Re: Lexicographical access to arrays John Cowan (11 Apr 2026 04:03 UTC)
Re: Lexicographical access to arrays Bradley Lucier (11 Apr 2026 17:37 UTC)

Lexicographical access to arrays John Cowan 09 Apr 2026 18:59 UTC

Common Lisp has an accessor (array-major-aref a n) which retrieves the
nth element of an array enumerated in lexicographical order.  As such,
it also comes with a setter:  (setf (array-major-aref a n) x) where x
is the new value.  Setf is equivalent to SRFI 17's version of `set!`,
and replaces essentially all mutator functions in CL (rplaca and
rplacd are still there for hysterical raisins).

It seems partly possible to emulate this using array-body and
array-indexer, but then you have to know what kind of body you have
(vector, @vector, or something else).  I think it would be worth
adding these.  (Maybe there's a way to do them already, in which case
it would be worth pointing it out in 231bis.)