[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexical-binding is turned on in more use cases
From: |
Richard Stallman |
Subject: |
Re: lexical-binding is turned on in more use cases |
Date: |
Tue, 10 Mar 2020 23:06:38 -0400 |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> (defun my-make-counter ()
> (let ((counter 0))
> (lambda () (setq counter (1+ counter)))))
> (setq mc (my-make-counter))
> (funcall mc) => 1
> (funcall mc) => 2 ; etc.
> If you eval (my-make-counter) with lexical-binding off, the result is
> not functional.
It is clear that my-make-counter needs to be run with lexical binding.
The closure it returns also needs to be run with lexical binding.
However, it seems like a bug that the lexical-dynamic mode in effect
around the _call_ to my-make-counter has any effect on how it runs.
It seems to me that if the definition of my-make-counter comes from a
file that specifies lexical, it should run with lexical bindings
regardless of where it is called from.
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
- Re: lexical-binding is turned on in more use cases, (continued)
- Re: lexical-binding is turned on in more use cases, Michael Heerdegen, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Michael Heerdegen, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Noam Postavsky, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Michael Heerdegen, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Noam Postavsky, 2020/03/12
- Re: lexical-binding is turned on in more use cases,
Richard Stallman <=
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/11
- Re: lexical-binding is turned on in more use cases, Michael Heerdegen, 2020/03/12
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/10
- Re: lexical-binding is turned on in more use cases, John Wiegley, 2020/03/11
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/09
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/09
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/10