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

Re: AREF-1D, SEQUENCE-FUNCTIONS-EXCLUDE-ARRAYS



    Date: 27 Apr 87 11:51 PDT
    From: Masinter.pa@Xerox.COM
    Re:   AREF-1D, SEQUENCE-FUNCTIONS-EXCLUDE-ARRAYS

    How does this (new) proposal relate to the (old) proposal by Touretsky?

[For Touretzky's context, the "new" proposal being referred to was one to
 introduce a function AREF-1D (later renamed to ROW-MAJOR-AREF to correspond
 to a name chosen earlier by Steele in a suggested clarifications document
 he distributed).]

    I'm uncomfortable leaving SEQUENCE-FUNCTIONS-EXCLUDE-ARRAYS unfinished
    while going ahead with a separate proposal which seems to relate to
    similar concerns.

    Comments?

At first I wondered if the omission of a proposal to generalize AREF so
that if you gave it a single index it (implicitly asserting it to be a 
vector, and hence a sequence), then it should just do a 1-d AREF (as ELT
would do). In fact, however, I think this would decrease error checking
in an undesirable way and my guess is that Touretzky was being very
deliberate in not including a proposal to do this.

Moreover, although some compilers might treat
 (ELT (THE ARRAY X) 3)
as efficiently as
 (ROW-MAJOR-AREF X 3)
I don't think anyone would be willing to require such efficient treatment.
In compilers which didn't optimize this (and in most interpreters, too)
you'd still have to do the LISTP check before getting around to the
implicit ROW-MAJOR-AREF. Although it isn't suggested that ROW-MAJOR-AREF
is needed only for efficiency, it is true that most applications where it's
likely to be used need maximal efficiency, so I think making it a separate
primitive is appropriate.

All this being said, I think it's safe to make these two proposals proceed
in parallel without worrying that they conflict in some way. If you're not
convinced, please let me know.