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: Clément Pit-Claudel
Subject: Re: If records are not sequences, why does aref work on records?
Date: Fri, 7 Apr 2017 15:25:27 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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.
It's a bit like hashtables: if I have multiple hashtables that all have an 
"age" key, I can access that key independently of what else is in the table.



reply via email to

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