bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#40693: 28.0.50; json-encode-alist changes alist


From: João Távora
Subject: bug#40693: 28.0.50; json-encode-alist changes alist
Date: Sat, 23 May 2020 20:40:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> João Távora <joaotavora@gmail.com> writes:
>> "Basil L. Contovounesios" <contovob@tcd.ie> writes:

> 0. bar.el does not use lexical-binding.
> 1. The second lambda in forty-two does not let-bind foo-42.
> 2. If you byte-compile bar.el with bar-have-native-42 set to t, and then
>    load bar.elc in an Emacs that has bar-have-native-42 set to nil, then
>    42.0 gets printed, which is wrong.  This is due to the incorrect
>    usage of eval-when-compile: we want the check to happen at runtime as
>    well.

I think you mean load-time.  Anyway, this is true if you want 27.1 elc's
to be loadable in 26.x. I was labouring under the impression that we
don't care about that (and this is why I thought of the macro approach).
Do we?  The source file is compatible between multiple emacs version,
but is the byte-compiled file also compatible?

>> No idea how to check if byte-code is "valid" or not: I just check the
>> warnings.  Can you tell me?
> 
> 0. emacs -Q -batch -f batch-byte-compile foo.el
> 1. emacs -Q
> 2. (fset 'json-parse-buffer nil) C-j
> 3. M-x load-file RET foo.elc RET
> 4. (disassemble 'foo) C-j

Thanks.

> I think the declarations make the intention explicit to both the reader
> and the byte-compiler in a simple way, without wrestling the
> eval-*-compile machinery or allowing for subtle bugs like the ones
> above.

The problem, of course, is that you're repeating yourself, a maintenance
hazard.  Not too big in this case.

João





reply via email to

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