* Re: [Emacs-diffs] scratch/record 453b0ed: Update documentation for type semantics of records.
[not found] ` <20170405064706.5B4C4210A4@vcs0.savannah.gnu.org>
@ 2017-04-05 14:19 ` Stefan Monnier
2017-04-06 7:18 ` Lars Brinkhoff
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2017-04-05 14:19 UTC (permalink / raw
To: emacs-devel; +Cc: Lars Brinkhoff
> + The type slot should be a symbol or a record. If it's a record,
> +@code{type-of} assumes it's an EIEIO (@pxref{Top,,,eieio,EIEIO}) type
> +descriptor and returns the contents of slot 1. Any other kind of
> +object is returned as-is.
Actually, it just assumes that the type name name is in field 1, which
without any reference to EIEIO.
The assumption is that we can arrange for any kind of type descriptor to
put a name in there. E.g. it's true for `eieio--class`,
`cl-structure-class` as well as their shared parent `cl--class`. And we
could arrange for it to also be true of a type descriptor for, say, the
`integer` type, if we ever decide to introduce a type descriptor for
primitive types like `integer`.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Emacs-diffs] scratch/record 453b0ed: Update documentation for type semantics of records.
2017-04-05 14:19 ` [Emacs-diffs] scratch/record 453b0ed: Update documentation for type semantics of records Stefan Monnier
@ 2017-04-06 7:18 ` Lars Brinkhoff
0 siblings, 0 replies; 2+ messages in thread
From: Lars Brinkhoff @ 2017-04-06 7:18 UTC (permalink / raw
To: emacs-devel
Stefan Monnier wrote:
>> + The type slot should be a symbol or a record. If it's a record,
>> +@code{type-of} assumes it's an EIEIO (@pxref{Top,,,eieio,EIEIO}) type
>> +descriptor and returns the contents of slot 1. Any other kind of
>> +object is returned as-is.
>
> Actually, it just assumes that the type name name is in field 1, which
> without any reference to EIEIO.
Ok, I have updated the documentation.
> The assumption is that we can arrange for any kind of type descriptor
> to put a name in there. E.g. it's true for `eieio--class`,
> `cl-structure-class` as well as their shared parent `cl--class`.
Then I suppose this new `type descriptor' concept should be documented
somewhere. I'll submit a draft.
> And we could arrange for it to also be true of a type descriptor for,
> say, the `integer` type, if we ever decide to introduce a type
> descriptor for primitive types like `integer`.
We'd have to do that if we were to introduce `class-of'. But there
doesn't seem to be a pressing need for that.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-06 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170405064705.1019.72963@vcs0.savannah.gnu.org>
[not found] ` <20170405064706.5B4C4210A4@vcs0.savannah.gnu.org>
2017-04-05 14:19 ` [Emacs-diffs] scratch/record 453b0ed: Update documentation for type semantics of records Stefan Monnier
2017-04-06 7:18 ` Lars Brinkhoff
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.