all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, 30078@debbugs.gnu.org
Subject: bug#30078: 27.0.50; Use lexical-binding for M-:
Date: Mon, 19 Mar 2018 16:50:34 -0400	[thread overview]
Message-ID: <jwv370vls5c.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <83tvtbn7wk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 19 Mar 2018 22:10:35 +0200")

>> lexbind-Elisp language is a strict superset of the
>> dynbind-Elisp language and for that reason I don't see any reason other
>> than backward compatibility to keep dynbind-Elisp.
>> 
>> I'm not trying to fool people by "doing it one subtle step at a time",
>> I'm only trying to make this switch as painless as possible.  I don't
>> yet have a plan for how we'll get rid of dynbind-Elisp and I'm sure
>> it'll take many years and several more steps, some of them less subtle
>> than others.  Some of the steps I could imagine introducing in the not
>> too distant future:
>> - finish converting all Emacs's .el files to use lexical-binding:t.
>> - emit a warning when opening an Elisp file which doesn't specify
>>   `lexical-binding:t' in its local vars.
>> - emit a warning when `eval` is called without a nil 2nd arg.
>
> 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.

> 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.  Note that it's
usually easy to tweak that code to make it work again, tho it is
occasionally a bit more painful.  And we usually introduce other
backward incompatibilities along the way, so it's rather rare for 20
year old Elisp code to still run correctly unmodified.

>> 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.
What other language(s) do you know/use?  Which scoping do they support?


        Stefan





  reply	other threads:[~2018-03-19 20:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 16:36 bug#30078: 27.0.50; Use lexical-binding for M-: Stefan Monnier
2018-01-11 20:58 ` Michael Heerdegen
2018-01-12 14:58   ` Stefan Monnier
2018-01-12 16:12     ` Stefan Monnier
2018-01-12 16:53       ` Glenn Morris
2018-01-12 17:23       ` Michael Heerdegen
2018-01-12 18:47         ` Stefan Monnier
2018-01-12 19:35           ` Michael Heerdegen
2018-01-13 17:58             ` Stefan Monnier
2018-01-12 18:34       ` Eli Zaretskii
2018-01-12 18:49         ` Stefan Monnier
2018-01-12 18:55           ` Eli Zaretskii
2018-01-12 19:06             ` Stefan Monnier
2018-01-12 20:03               ` Eli Zaretskii
2018-01-12 20:33                 ` Noam Postavsky
2018-01-12 20:55                 ` Michael Heerdegen
2018-01-12 21:04                   ` Eli Zaretskii
2018-01-12 21:11                     ` Michael Heerdegen
2018-01-13 17:50                       ` Luis Gerhorst
2018-01-13 19:48                         ` Eli Zaretskii
2018-01-13 20:19                           ` Luis Gerhorst
2018-01-14  5:58                           ` Robert Cochran
2018-01-13 18:19                     ` Stefan Monnier
2018-01-13 19:34                       ` Eli Zaretskii
2018-01-13 21:58                         ` Stefan Monnier
2018-01-13 23:18                       ` Richard Stallman
2018-01-14  2:07                       ` Drew Adams
2018-01-15  2:34                         ` Richard Stallman
2018-01-13 18:05                 ` Stefan Monnier
2018-01-13 19:37                   ` Eli Zaretskii
2018-03-19 19:32       ` Stefan Monnier
2018-03-19 19:34         ` Stefan Monnier
2018-03-19 20:10         ` Eli Zaretskii
2018-03-19 20:50           ` Stefan Monnier [this message]
2018-03-20  6:59             ` Eli Zaretskii
2018-03-20 19:20               ` Stefan Monnier
2018-04-02 19:40                 ` Richard Stallman
2018-04-03  0:12                   ` Stefan Monnier
2018-04-03 16:50                     ` Richard Stallman
     [not found] <mailman.7210.1515688689.27995.bug-gnu-emacs@gnu.org>
2018-01-12 16:28 ` nazienham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv370vls5c.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=30078@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.