Subject: Re: bug#30078: 27.0.50; Use lexical-binding for M-:

From: Eli Zaretskii <[email-masked]>
Date: Tue, 20 Mar 2018 08:59:12 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Mon, 19 Mar 2018 16:50:34 -0400
> 
> > Really?  Get rid of dynamic binding in ELisp?
> 
> Not sure if by "dynamic binding" you mean "the variant of Elisp
> corresponding to lexical-binding = nil" (which I call dynbind-Elisp) or
> "some new Elisp variant where dynamic binding has been removed
> altogether" (which doesn't currently exist AFAIK).
> 
> I have no intention to eliminate dynamic binding from Elisp at all.
> What I'd like to see happen within the next, say, 20 years is to get rid
> of the `lexical-binding` variable (i.e. treat everything as if this var
> were always non-nil and as if `eval`s second arg was always non-nil), so
> that dynamic binding only ever happens for those variables that have
> been explicitly declared to be dynamic with `defvar` (as is the case in
> what I call the lexbind-Elisp language).
> 
> > Why is that a good idea?
> 
> Because, having two languages is a bit inconvenient and brings extra
> complexity: e.g. some code snippets only work right in one of the two
> languages (usually nowadays it's in the lexbind variant, AFAICT), so you
> need to label them appropriately.

Are that inconvenience and complexity really so bad?  They don't sound
like that.

> > It would mean old code will not run in Emacs for no good reason.
> 
> That's true.  Which is why it's a long-term goal only.

I'm asking why make it a goal at all.

> >> It's dynamic binding which is the odd one out
> > Not for me, it isn't.  Maybe that means _I_ amd the odd one out.
> 
> Beside Elisp, I know you're familiar with at least one other language
> which only supports lexical scoping: C.

Global variables in C are very similar to dynamic binding, so I had no
problem getting used to ELisp at the time.

> What other language(s) do you know/use?  Which scoping do they support?

Every language I ever used (which is not a lot) supports global
variables, so again, no problems in that department.

Or maybe I again misunderstand what you mean by "dynbind".

Anyway, I don't think it's worth our while to discuss what is or isn't
a problem for me personally.  The popular style of writing Emacs Lisp
nowadays is very different from what it was 20 or 25 years ago, when I
learned the language, which is an obstacle to someone like myself, who
is not very interested in programming languages and their facilities.