emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] * etc/NEWS: Document incompatibilities introduced by record


From: Philipp Stephani
Subject: Re: [PATCH] * etc/NEWS: Document incompatibilities introduced by record types.
Date: Thu, 21 Dec 2017 17:34:47 +0000



Noam Postavsky <address@hidden> schrieb am Mi., 13. Dez. 2017 um 02:13 Uhr:
On Tue, Dec 12, 2017 at 8:03 PM, Stefan Monnier
<address@hidden> wrote:
>> If programmers are not supposed to do it, let's detect it and report
>> an error when they try.  That way, they will know it's an error as
>> soon as they try, rather than needing to debug it to find out it's an error.
>
> Why haven't we applied that same rule to (fset 'apply ...)?
> How about (use-global-map (make-keymap))?

I thought you already agreed we should make "define an 'integer'
struct" an error, why are we still arguing about this?

https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00400.html


Even after changing defstruct, you can still use make-record to create the behavior described here:

(let ((o (make-record 'integer 0 nil)))
  (type-of o))
integer

(let ((o (make-record 'hash-table 0 nil)))
  (prin1-to-string o))
"#s(hash-table)"

My suggestion would be to either at least document this breaking change (this patch), or forbid such records, or change the return value in a non-breaking way (such as using '(record integer) and "#r(integer)").

reply via email to

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