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

Hairiness of arrays

Common Lisp arrays aren't necessarily all that hairy, frankly.  The Lisp
machine array leader feature was rejected as part of Common Lisp.  They
have fill pointers (when one-dimensional), but those are very simple to
implement if you don't mind having one word of overhead.  They are
multi-dimensional, but the number of dimensions in an array reference can
be detected at compile time, and surely needn't make the 1-dimensional case
less efficient.  And I think by now people know how to implement the
multi-dimensional ones.  They have a variety of packing types (word, byte,
bit), but so do vectors.

The only hairy feature Common Lisp arrays have is indirection
(displacement).  This isn't very important in Common Lisp, in my opinion,
and I don't think I ever advocated it.  It would not be a terrible idea to
flush it if that makes life substantially easier for some other
implementations.  I have yet to see a piece of code that used NSUBSTRING
and wasn't doing something wrong; NSUBSTRING is about the only Common Lisp
application for array indirection, except for something, perhaps confused,
going on with ADJUST-ARRAY-SIZE.  (The Lisp machine needs indirect arrays,
but not primarily for things that would be portable to other Common Lisp