[Top][All Lists]

[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: Fri, 24 Mar 2017 11:15:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Stefan Monnier wrote:
> BTW, I see further compatibility problems:
> if you compile a chunk of code which constructs structs, they get
> macroexpanded/inlined to code that does either
>     (record 'FOO <args>)
> or
>     (vector 'cl-struct-FOO <args>)
> depending on whether the corresponding cl-defstruct is using the old or
> the new style.
> So if this is in a different file from the one that does the
> `cl-defstruct` you can end up with a situation where the
> `cl-define-struct` defines a new-style struct (because it was recently
> recompiled), while some code constructs old style structs of that
> same type (because it hasn't been recompiled recently).

The easy way out would seem to have old-struct-compat set to t by
default.  Then, maybe next major release default to nil.

Or check something in the .elc file when it's loaded.  The Emacs version
number is there (or if it isn't, it's really ancient; looking at you
Emacs 16).  Explicit information about using records could be put in.

reply via email to

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