emacs-devel
[Top][All Lists]
Advanced

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

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


From: Paul Eggert
Subject: If records are not sequences, why does aref work on records?
Date: Fri, 7 Apr 2017 09:56:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 04/07/2017 12:40 AM, Lars Brinkhoff wrote:
I think there are only a few functions that wants a sequence but not a
record: elt, copy-sequence, concat, reverse, and sort.

It is confusing that aref works on records but copy-sequence etc. do not. This behavior of aref is not documented in the aref doc string, or in the Lisp manual under aref.

How about if we define a new function record-ref to be used on records, instead of aref? At the low level this would insulate records better from the rest of Emacs Lisp, which I think is the intent -- as I understand it, records are supposed to be used to create new types, and are not supposed to be sorts of aliases for sequences.




reply via email to

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