[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: |
Noam Postavsky |
Subject: |
Re: If records are not sequences, why does aref work on records? |
Date: |
Fri, 7 Apr 2017 15:07:31 -0400 |
On Fri, Apr 7, 2017 at 2:30 PM, Drew Adams <address@hidden> wrote:
>>
>> So what do you think about the byte-code type, which supports many, but
>> not all, sequence operations? Is that a long-standing bug?
>
> I know nothing about it; sorry. If it is then it is.
>
> Emacs, like Common Lisp, should have a well-defined sequence
> type. We aren't required to model ours on CL's, but other
> things being equal it wouldn't be a bad idea to look to CL
> for guidance/inspiration.
AFAIK, CL's structures (if defined without a :type argument) are not
sequences, and I don't see any need for Elisp's to be either.
To quote the elisp manual: "The common property that all sequences
have is that each
is an ordered collection of elements." A record's elements are more
like an unordered set. If you do (cl-defstruct person age height), you
don't care whether 'age' goes before 'height', just that person-age
gives you the age field. And some sequence operations make no sense on
records: e.g., doing 'sort' or 'reverse' on a record would not result
in a valid record.
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.
- Re: Debugging problems using async.el, (continued)
- Re: Debugging problems using async.el, Eli Zaretskii, 2017/04/07
- Re: Debugging problems using async.el, Lars Brinkhoff, 2017/04/07
- Re: Recent change in master breaks async package update using paradox, Stefan Monnier, 2017/04/07
- What is a "sequence"?, Lars Brinkhoff, 2017/04/07
- Re: What is a "sequence"?, Stefan Monnier, 2017/04/07
- If records are not sequences, why does aref work on records?, Paul Eggert, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Lars Brinkhoff, 2017/04/07
- RE: If records are not sequences, why does aref work on records?, Drew Adams, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Lars Brinkhoff, 2017/04/07
- RE: If records are not sequences, why does aref work on records?, Drew Adams, 2017/04/07
- Re: If records are not sequences, why does aref work on records?,
Noam Postavsky <=
- Re: If records are not sequences, why does aref work on records?, Stefan Monnier, 2017/04/07
- RE: If records are not sequences, why does aref work on records?, Drew Adams, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Clément Pit-Claudel, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Noam Postavsky, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Paul Eggert, 2017/04/07
- Re: If records are not sequences, why does aref work on records?, Lars Brinkhoff, 2017/04/08
- Re: If records are not sequences, why does aref work on records?, Lars Brinkhoff, 2017/04/08
- Re: If records are not sequences, why does aref work on records?, Noam Postavsky, 2017/04/08
- Re: If records are not sequences, why does aref work on records?, Paul Eggert, 2017/04/08
- Re: If records are not sequences, why does aref work on records?, Eli Zaretskii, 2017/04/08