[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default lexical-binding to t
From: |
Joost Kremers |
Subject: |
Re: Default lexical-binding to t |
Date: |
Wed, 06 Nov 2024 21:48:05 +0100 |
On Wed, Nov 06 2024, Alan Mackenzie wrote:
> Maybe briefly explaining the philosophy of lexical binding somewhere
> (maybe NEWS) would help.
>
> I still don't understand it. I go along with lexical binding because
> quite a lot of people cleverer than me have said it is good. But why?
The Elisp manual has a few short remarks on it:
(info "(elisp) Lexical Binding")
,----
| Lexical binding was introduced to Emacs, as an optional feature, in
| version 24.1. We expect its importance to increase with time. Lexical
| binding opens up many more opportunities for optimization, so programs
| using it are likely to run faster in future Emacs versions. Lexical
| binding is also more compatible with concurrency, which was added to
| Emacs in version 26.1.
`----
and:
(info "(elisp) Dynamic Binding")
,----
| Note that when code using Dynamic Binding is native compiled the
| native compiler will not perform any Lisp specific optimization.
`----
AFAIU, dynamic binding is especially dangerous if you're in the habit of
setting variables without let-binding them. A coding style that was perhaps
more common in the past than it is now.
--
Joost Kremers
Life has its moments
- Re: Default lexical-binding to t, (continued)
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/04
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/05
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/06
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/06
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/06
- Re: Default lexical-binding to t, Stefan Monnier, 2024/11/06
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/06
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/06
- Re: Default lexical-binding to t,
Joost Kremers <=
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/06
- Re: Default lexical-binding to t, Stefan Kangas, 2024/11/06
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/07
- Re: Default lexical-binding to t, Stefan Kangas, 2024/11/07
- Re: Default lexical-binding to t, Richard Stallman, 2024/11/09
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/07
- Re: Default lexical-binding to t, Joost Kremers, 2024/11/07
- Re: Default lexical-binding to t, Eli Zaretskii, 2024/11/07
- Re: Default lexical-binding to t, tomas, 2024/11/07
- Re: Default lexical-binding to t, Alan Mackenzie, 2024/11/07