emacs-devel
[Top][All Lists]
Advanced

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

Re: Why is lexical-binding's global value ignored?


From: tomas
Subject: Re: Why is lexical-binding's global value ignored?
Date: Sat, 28 Jan 2023 08:10:23 +0100

On Fri, Jan 27, 2023 at 08:01:47PM -0700, abq@bitrot.link wrote:
> If somebody does (setq-default lexical-binding t), the intention is obvious.
> But in current versions of Emacs, when loading a file that doesn't specify a
> local value for lexical-binding, the global value is ignored. Why?
> 
> IOW, what would break if the global value were honored? It defaults to nil,
> which is already how files are loaded if no local value is specified, so
> honoring the global wouldn't change anything by default.

I think it's backward compatibility, mainly. Files with no explicit
lexical binding setting (may) contain code which expects dynamic
binding and would break.

It's not about the code distributed with Emacs, but about the code you
have been using for 15 years which would fail in obscure ways.

IOW, "not having a binding declaration in a file means dynamic binding"
has become a contract :-)

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

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