From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: lexical-binding is turned on in more use cases Date: Tue, 10 Mar 2020 21:36:14 -0400 Message-ID: References: <83k13ubv3g.fsf@gnu.org> <83imjebsrh.fsf@gnu.org> <20200308193048.GB4832@ACM> <20200310191328.GB5046@ACM> <87lfo7q5e3.fsf@web.de> <20200310215334.GG5046@ACM> <87eetz4w1k.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="45111"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Mackenzie , Eli Zaretskii , Stefan Monnier , Emacs developers To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 11 02:37:20 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 1jBqJE-000BdF-0v for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Mar 2020 02:37:20 +0100 Original-Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBqJD-0007kz-3X for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 21:37:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51033) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBqIW-0006vb-Us for emacs-devel@gnu.org; Tue, 10 Mar 2020 21:36:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBqIV-0002km-RI for emacs-devel@gnu.org; Tue, 10 Mar 2020 21:36:36 -0400 Original-Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:45707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jBqIS-0002Zj-Ro; Tue, 10 Mar 2020 21:36:32 -0400 Original-Received: by mail-oi1-x22d.google.com with SMTP id v19so256200oic.12; Tue, 10 Mar 2020 18:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6rZPhT//jGtdqnkuXTs1eDc7QHxsJqAG2iIK9OYeIIg=; b=eJDsrJvraGdUcjrX+bik0YaDwC9aFZ7c1YcaHRuWz8ArBZwhkPGr83Z/dSBzUKGStQ yKMWN7VGVdcpxraACZ1tq02Bfk3ZxsuXfBx1WlEV30jWSTLdw93bV1AnenO2yELnmjGp LszPuU1sjmtYPp14WSWZWYoB3CfOC9r1TnE1QuG6qwFIJhUWgZOywpnhsYTQqAEAcI5a na9+sXeFaTLexTGT4JisnX1elBy/Iuxv19HYjFbMzhbRsGwupa7wxrtcUB83Fvzuf4us rLGR2AzOw/GeTG2JKuRrKdKknwQ9Bq+LiWlGyHczSUyfIsOuC/2h8ooZF2g/UiCs/Y+j 48ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6rZPhT//jGtdqnkuXTs1eDc7QHxsJqAG2iIK9OYeIIg=; b=kEVXxcMI9p9xDbQEcVhORWj1od3aYfhp8Jsu0zNnHPPvQil9XJfy5eHCkQyLF0GU54 D2pBU5+uLnDyCD+T3aAxqZuG/hV4mreivd7BzX8UP1jeoH9vQiQogNcSfgTxtEfOrjwi DPVjKPoK5D8SzvlNGhkTAyDxTnjw2ozhWAg5C9rg5CiAKpcHkfV9RK1FLjDkmyklNO1f IXl14PWo15U1MZ4AhQBD/vd6QDobsUmIOi3A4FHmvCVZxW4GQX3KpPuZt2ZXiUXzEhF9 eDqQnYP4YNTfU2Uoru0b+pwlJOfrOssUdxSdRiBo4qulAdukW9kiZ14UdGam5XpSLYxi MeDQ== X-Gm-Message-State: ANhLgQ1QqINtSJrtNGYlWGkeH6vnoB2HUafIVLbNF3pc1rdas56SBjiF LAoCC0B3tkZJPF/ShD3fdGymBKqA+RudbA6BIlI= X-Google-Smtp-Source: ADFU+vu/zgHQAa817MVjUcr/Y2mqzSAXIO+3hk76bDDxgp+R1dkCdSwcKFea6XFP7dxk0/nHfLu6UWvMbJRVu/7i4w8= X-Received: by 2002:aca:534d:: with SMTP id h74mr316349oib.173.1583890591911; Tue, 10 Mar 2020 18:36:31 -0700 (PDT) In-Reply-To: <87eetz4w1k.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::22d 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:245464 Archived-At: On Tue, 10 Mar 2020 at 19:42, Michael Heerdegen wrote: > (defun my-make-counter () > (let ((counter 0)) > (lambda () (setq counter (1+ counter))))) > > (setq mc (my-make-counter)) > If you eval (my-make-counter) with lexical-binding off, the result is > not functional. Actually, it only fails if you evaluate the (defun my-make-counter ...) with lexical-binding off. > Were does M-: break for you with the change? Please, let's not go in circles. An example was already given upthread: https://lists.gnu.org/r/emacs-devel/2020-03/msg00219.html Essentially some cc-mode variables are only declared dynamic locally within individual files. Without lexical binding the only difference this causes is that they are unbound at top level; but with lexical-binding, outside of the declaring files (e.g., in M-: expressions), let-binding those variables doesn't bind the value dynamically.