emacs-devel
[Top][All Lists]
Advanced

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

Re: lexical-binding is turned on in more use cases


From: Michael Heerdegen
Subject: Re: lexical-binding is turned on in more use cases
Date: Wed, 11 Mar 2020 03:02:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Noam Postavsky <address@hidden> writes:

> Actually, it only fails if you evaluate the (defun my-make-counter
> ...) with lexical-binding off.

That's what I expected, too, but I tested it quickly and it was as I
said...sorry, it's late here.  Maybe byte compiling the source also
makes a difference?

> > Were does M-: break for you with the change?
>
> Please, let's not go in circles. An example was already given
> upthread: https://lists.gnu.org/r/emacs-devel/2020-03/msg00219.html
>
> Essentially some cc-mode variables are only declared dynamic locally
> within individual files. Without lexical binding the only difference
> this causes is that they are unbound at top level; but with
> lexical-binding, outside of the declaring files (e.g., in M-:
> expressions), let-binding those variables doesn't bind the value
> dynamically.

I meant "real" examples (that are not actually coding errors).  I
guess, like let-binding a variable that is not (yet) declared around an
expression whose evaluation will autoload the declaration but it's too
late for that binding and you get something unexpected.

Michael.



reply via email to

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