help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: [External] : Re: Printing alist pairs to a dedicated buffur


From: Drew Adams
Subject: RE: [External] : Re: Printing alist pairs to a dedicated buffur
Date: Thu, 25 Apr 2024 23:38:19 +0000

> >> `setq' creates global static/lexical variables
> >
> > Not true.
> 
> As you know -
> unless there already is another variable with that name, and
> such as that can be present in many forms (`let' bindings,
> formal parameters etc) including dynamic/special variables and
> if so it remains dynamic/special with `setq' but otherwise
> it'll be static/lexical.

Yes, you understand `let', and using `setq'
inside `let', correctly.

(And in that regard, Elisp `let' is like CL
`let'.  But Elisp also has buffer-local etc.)

> > As (elisp) "Scoping Rules for Variable Bindings" says:
> >
> >   "By default, the local bindings that Emacs
> >    creates are "dynamic bindings".
> >    ...
> >    The dynamic binding was (and still is)
> >    the default in Emacs for many years [...]
> 
> Emacs is de facto static/lexical.

No, it's not.  Not yet.

>   $ cd ~/src/emacs
>   $ ls **/*.el | wc -l
>   2312
>   $ head **/*.el | grep -I "lexical-binding" | wc -l
>   2285

That just shows that most Elisp files provided
with Emacs have `lexical-binding' = t.

Dynamic binding is still the default in Elisp.
The doc is correct about that.
___


Let us know, when you use lexical binding for
_all_ your defuns, as well as for defface and
all the rest. ;-)



reply via email to

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