From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: lexical-binding is turned on in more use cases Date: Tue, 10 Mar 2020 21:02:11 +0000 Message-ID: <20200310210211.GF5046@ACM> References: <83k13ubv3g.fsf@gnu.org> <83imjebsrh.fsf@gnu.org> <20200308193048.GB4832@ACM> <20200310191328.GB5046@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="120833"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 22:03:19 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBm23-000VMS-EY for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 22:03:19 +0100 Original-Received: from localhost ([::1]:40258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBm22-0007ih-Fk for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 17:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39604) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBm14-0006nM-Ao for emacs-devel@gnu.org; Tue, 10 Mar 2020 17:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBm11-00054r-Ld for emacs-devel@gnu.org; Tue, 10 Mar 2020 17:02:17 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:61104 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jBm11-000521-Bw for emacs-devel@gnu.org; Tue, 10 Mar 2020 17:02:15 -0400 Original-Received: (qmail 16485 invoked by uid 3782); 10 Mar 2020 21:02:13 -0000 Original-Received: from acm.muc.de (p4FE1593B.dip0.t-ipconnect.de [79.225.89.59]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 10 Mar 2020 22:02:11 +0100 Original-Received: (qmail 5238 invoked by uid 1000); 10 Mar 2020 21:02:11 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245454 Archived-At: Hello, Stefan. On Tue, Mar 10, 2020 at 16:41:43 -0400, Stefan Monnier wrote: > > What specific real problem does forcing M-: to use lexical binding solve? > Make it behave the way coders who use lexical-binding (which I believe > are now the majority) expect. So, you admit there is no specific problem solved by forcing lexical binding in M-:? Lexical binding is useless for M-:. It can't do anything useful. Unless (contrived example) somebody is going to type in the code for creating a closure into the minibuffer. Or something like that. Is this really why you want to force lexical-binding in M-:? I would think that ALL emacs coders, whether working with lexical-binding nil or t, would expect to be able to bind a dynamic variable, any dynamic variable, in a let form in M-: > You likely won't write code that relies on lexical scoping since you're > used to writing dynamically scoped code, but many coders nowadays never > touch dynamically scoped code and hence very much expect the lexical > binding rules, which is mostly the ability to use closures (which is > sometimes present only implicitly via macros like `gv-ref` (itself used > in other macros like `add-function`), thunk.el and generator.el macros, > ...). So, what we need here is a customisation variable, so that people who want lexical binding in M-: can have it, and those who want dynamic binding can also have that. Agreed? I'll code it up. > Stefan -- Alan Mackenzie (Nuremberg, Germany).