emacs-devel
[Top][All Lists]
Advanced

[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



reply via email to

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