emacs-devel
[Top][All Lists]
Advanced

[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:41:14 -0400

On Fri, Apr 7, 2017 at 3:25 PM, Clément Pit-Claudel
<address@hidden> wrote:
> On 2017-04-07 15:07, Noam Postavsky wrote:
>> 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.
>
> Sometimes you do — for example, you might know that multiple structures in 
> your application have the same data in their first field, and if so (aref x 
> 1) should work.

In that case, you should be probably be using :include for the common
parts, or else :type to explicitly use vectors. I'm sure you can come
up with exceptions to that too though :)



reply via email to

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