[Top][All Lists]

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

RE: If records are not sequences, why does aref work on records?

From: Drew Adams
Subject: RE: If records are not sequences, why does aref work on records?
Date: Fri, 7 Apr 2017 13:49:36 -0700 (PDT)

> > If we decide to support aref or copy-sequence on records for
> > efficiency or backwards compatibility that doesn't mean we want them
> > to be full sequences.
> FWIW, I agree.  I think we do need aref and copy-sequence to work on
> them, for backward compatibility reasons, but `sequencep` should
> return nil.

If such an approach is taken, with `copy-sequence' repurposed
instead of having a new function to do the job, then its
doc will need to be changed, to clarify that the arg and the
result are not necessarily sequences.

I don't know why we would want to pollute it that way.
Let `copy-sequence' be a sequence function.

I don't understand the backward-compatibility argument.
A record type has not existed before.  When/where do we
already have `aref'/`copy-sequence' being applied to
something other than a sequence/array?

Oh, I see.  Someone long ago let `aref' apply to byte code.
Too bad.  But what about `copy-sequence' - what backward
compatibility is involved there?

And why does `aref' apply to byte code?  Should byte code
perhaps be deemed an array (satisfy `arrayp')?

Or should we add a new function for byte code, to replace
the use of `aref' - and deprecate the latter?  Seems like
`aref', just as for Common Lisp, should apply only to an

reply via email to

[Prev in Thread] Current Thread [Next in Thread]