emacs-devel
[Top][All Lists]
Advanced

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

Re: Should records be able to mimic primitive types?


From: Stefan Monnier
Subject: Re: Should records be able to mimic primitive types?
Date: Tue, 04 Apr 2017 21:09:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> In looking at the 'record' feature recently added to master, I noticed that
> (record 'integer 'foo 'bar) returns a value V such that (type-of V) yields
> the symbol 'integer', even though V is not an integer. Is this intended?

Yes.  `record` is just a primitive on top of which we can build things
(e.g. cl-defstruct or EIEIO).

> Or should 'record' and 'make-record' reject attempts to build records
> that pretend to be of primitive types?

I don't see the benefit in trying to try hard to prevent the user from
shooting himself in the foot.


        Stefan




reply via email to

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