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

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

Re: [External] : How to create a higher order function?


From: Emanuel Berg
Subject: Re: [External] : How to create a higher order function?
Date: Fri, 24 Sep 2021 11:38:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Drew Adams wrote:

> Wrt the advantages and uses of dynamic binding in the
> context of _Emacs_ - i.e., the reason why Emacs has, and
> should continue to have, dynamic binding (along with
> lexical binding), see RMS's arguments here:
>
> https://www.gnu.org/software/emacs/emacs-paper.html#SEC17
> https://www.gnu.org/software/emacs/emacs-paper.html#SEC18

If that's the "options" argument I don't see what's so
dynamic/special about that idea, to me they are global
variables rather like any global variable found in any
programming language ...

And BTW that idea is very basic so perhaps nothing to go
around hitting the big drum about :)

The only use-case I can see for dynamic/special variables is
to set value(s) to something different in a limited scope when
this can't practically be done because these values are not
settable thru function parameters. E.g. what `let' does under
dynamic binding (i.e., `lexical-binding' is nil). Maybe for
experimental/testing purposes ...

However as this is the rare case (if it happens often, the
functions should be changed to include such parameters, rather
- perhaps optional parameters and/or with keys) which is why
think static/lexical scope should be default, `let' should
_always_ be static/lexical and a/the dedicated let should
always be used if and when dynamic/special scope is
desired ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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