emacs-devel
[Top][All Lists]
Advanced

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

Re: User-defined record types, v2


From: Lars Brinkhoff
Subject: Re: User-defined record types, v2
Date: Sun, 19 Mar 2017 10:17:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Stefan Monnier wrote:
>> I initially added this function to check everywhere that the first
>> slot is a valid defstruct type name.  But then Stefan Monnier added
>> support for EIEIO instances and made the first slot be a class
>> object.
>
> But I'm not even sure we should enforce this in the `record` and
> `make-record` primitives.  After all, it's not needed for safety.  And
> since we allow (aset <obj> 0 <foo>) we can circumvent this check
> anyway.

Not quite.  `aset' does the check too.

Also, I thought about disallowing the built-in types.  I imagine some
code would rightly get confused if it saw `integer' for anything else
than integers.  But then, so much else in Emacs depends on people doing
sensible things, so maybe no check is needed at all.

If we come up with a need for a check, we know where to add it.  If not,
I can just delete the unused code.




reply via email to

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