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: Mon, 30 Jan 2023 13:59:52 +0100

On Mon, Jan 30, 2023 at 02:32:58PM +0200, Eli Zaretskii wrote:
> > Date: Sun, 29 Jan 2023 20:53:30 -0700
> > From: abq@bitrot.link
> > Cc: emacs-devel@gnu.org
> > 
> > On 2023-01-28 23:54, Eli Zaretskii wrote:
> > > Wasn't that already explained?  What happens if you say
> > > 
> > >   (setq-default lexical-binding t)
> > > 
> > > and then load a Lisp file that expects dynamic-binding by default?
> > 
> > Then it breaks!
> 
> We want to avoid such a breakage.  It is year 2023 out there, but
> there's still gobs of code that assumes dynamic binding.

Moreover, I still fail to understand why this is useful. Files
with no binding declaration have most probably been writen at
a time where dynamic binding was the only option [1]. So it does
make sense to treat them as if there were a "lexical-binding: f"
declaration in them. Everything else would be breaking the
interface contract. You better not do that (this would be the
same as changing the meaning of `+' for old programs: what
for?)

This means that the variable `lexical-binding' is always locally
bound, so its global binding is meaningless.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

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