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

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

RE: [External] : Lexical vs. dynamic: small examples?


From: Drew Adams
Subject: RE: [External] : Lexical vs. dynamic: small examples?
Date: Sat, 14 Aug 2021 13:35:57 +0000

The advantages of lexical binding are easy to find, and all of them are true 
advantages, for both programming and program analysis. The advantages of 
dynamic binding are not so easy to find, but they're quite important to an 
environment such as that of Emacs.

RMS gave good arguments _for Emacs_ (and similar, user-programmer environments) 
to support dynamic binding, here:

https://www.gnu.org/software/emacs/emacs-paper.html#SEC17

Every Emacs user should, I think, be aware of these advantages - as well as 
their attendant limitations/drawbacks.

Support of dynamic binding does _not_ require non-support of lexical binding.  

Common Lisp has purposefully had both from the outset (lexical is the default). 
 Emacs Lisp took a long time to add lexical binding (and it is still not the 
default), but it too has both now.  And yes, combining both in the same 
language provides perils as well as advantages.
___

This 1986 MIT video might be of interest here.  It goes over the introduction 
of side effects into a purely functional Scheme (Lisp-1 dialect).

https://www.youtube.com/watch?v=jl8EHP1WrWY

It talks about the motivation for doing that (and for dynamic binding, though 
that might not be mentioned explicitly in this session).

This is the 10th session of the Structure and Interpretation of Computer 
Programs course (presented by the authors), so it builds on top of a pure 
lambda-calculus model, with its many advantages of simple substitution etc.  
You have to imagine that context for this session, i.e., that until then only a 
purely functional, lexically scoped language was used/presented.

reply via email to

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