[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: User-defined record types
From: |
Lars Brinkhoff |
Subject: |
Re: User-defined record types |
Date: |
Tue, 14 Mar 2017 18:23:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> - If you don't pass the :type option to cl-defstruct, you get a
>> cl-struct-FOO type tag in slot 0.
>
> That's right. And this symbol's value is the class object.
> The same holds for EIEIO.
>
> These are the main candidates for use of the new `record` type.
Yes, at first I tried to make cl-deftype do this by default. But I ran
into problems in cl-preloaded.el and cl-generic.el.
>> - If you pass :type but not :named, you don't get any type tag.
>
> And those should not use `record` but `vector` or `list`
> depending on the :type that was specified.
>
>> - If you pass :type and :named, you get a type tag in slot 0, which is
>> the same symbol as the struct name.
>
> But again, these shouldn't use `record`.
Right, I just wanted to list all possible variations to gain some
understanding. For example, I don't know if it makes a difference if
the slot 0 type tag has the form cl-struct-FOO as is the default, or
just FOO as when you specify :type. But now I know there might be.
- Re: Elisp printer, (continued)
- Re: Elisp printer, Lars Brinkhoff, 2017/03/08
- Re: Elisp printer, Stefan Monnier, 2017/03/08
- Re: Elisp printer, Lars Brinkhoff, 2017/03/09
- User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Message not available
- Message not available
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Lars Brinkhoff, 2017/03/14
- Re: User-defined record types, Stefan Monnier, 2017/03/14
- Re: User-defined record types,
Lars Brinkhoff <=
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Lars Brinkhoff, 2017/03/15
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Lars Brinkhoff, 2017/03/15
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Lars Brinkhoff, 2017/03/15
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Stefan Monnier, 2017/03/15
- Re: User-defined record types, Lars Brinkhoff, 2017/03/16