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

Reply to KMP



I disagree with KMP's analysis of what VECTOR should do in the "RPG
memorial" proposal.  I think I confused him by talking about
"implementations that do not support vectors".  He seems to believe that
VREF, CHAR, and BIT would not work in such implementations.  That was
not my intent.

Perhaps the right way to look at it is to say that EVERY Common Lisp
implementation supports vectors.  In some implementations (notably
Zetalisp) vectors and 1-D arrays are the same thing; in other
implementations (including Vax and Spice Lisp) vectors are a restricted
subset of 1-D arrays.  VREF works only on vectors (it is equivalent to
AREF with a VECTOR declaration).  That means that in Zetalisp, VREF
would work on every 1-D array, and VECTORP would be true for every 1-D
array.  BIT-VECTORS and STRINGS would likewise be identical to
BIT-SEQUENCES and CHAR-SEQUENCES in Zetalisp.  I don't think this is
backwards.

I think that simple strings have to self-eval.  If it were up to me, all
arrays would self-eval, but this was voted down because it was felt that
it provided too little error checking.  I don't care whether general
char-sequences (or complex strings, whatever) self-eval or not, but I
think the Zetalisp folks would like the complex and simple strings to
behave pretty much the same.  I don't think that we want bit-vectors to
self-eval unless every vector does.  Similarly, I think EQUAL has to go
down into strings; it should not go down into bit-sequences unless it
goes down into every vector.

There are no user-visible array leaders in Common Lisp.  If an
implementation wants to provide user-visible additions to the Common
Lisp data structures (array leaders or property lists on strings or
whatever) it is up to that implementation to describe how these things
interact with the built-in features; all that is required is that legal
Common Lisp code run without modification.  I would suggest that EQUAL
and EQUALP not descend into such things, but it is really none of Common
lisp's business.

-- Scott