From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#49116: 28.0.50; Why `bound-and-true-p' is not working in lexical binding? Date: Mon, 21 Jun 2021 19:00:26 +0200 Message-ID: <87sg1b2lw5.fsf@web.de> References: <861r8yozg5.fsf@protected.rcdrun.com> <3157c274e97fc9db7ceb345ba020f74b@webmail.orcon.net.nz> <83lf76vwt8.fsf@gnu.org> <80a8a99b4e90c7508a88bb3b98f8545a@webmail.orcon.net.nz> <87tuluyopg.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38914"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Phil Sainty , 49116@debbugs.gnu.org, bugs@gnu.support To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 21 19:21:21 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lvNbs-0009tG-ON for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Jun 2021 19:21:20 +0200 Original-Received: from localhost ([::1]:38786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvNbr-0004Ep-Px for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Jun 2021 13:21:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvNJC-0005nE-65 for bug-gnu-emacs@gnu.org; Mon, 21 Jun 2021 13:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvNJB-00029c-U6 for bug-gnu-emacs@gnu.org; Mon, 21 Jun 2021 13:02:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvNJB-0003yD-Ii for bug-gnu-emacs@gnu.org; Mon, 21 Jun 2021 13:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Jun 2021 17:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49116 X-GNU-PR-Package: emacs Original-Received: via spool by 49116-submit@debbugs.gnu.org id=B49116.162429487515195 (code B ref 49116); Mon, 21 Jun 2021 17:02:01 +0000 Original-Received: (at 49116) by debbugs.gnu.org; 21 Jun 2021 17:01:15 +0000 Original-Received: from localhost ([127.0.0.1]:36872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvNIR-0003x1-Gt for submit@debbugs.gnu.org; Mon, 21 Jun 2021 13:01:15 -0400 Original-Received: from mout.web.de ([217.72.192.78]:47057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvNIO-0003wj-I9 for 49116@debbugs.gnu.org; Mon, 21 Jun 2021 13:01:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1624294827; bh=gLMpkGw6rxcPbdGGhOMHQI3zxU11/ALlvtvfw0xRHWA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=qep/h21dWCg/NUcWvTs4Q82hPoELnNpOuHwF2IAsRFl7VKmPFU9Ga/DTJYfGG/uq/ ePGKUWLV18oz0ki7XhmBHgW0m2oTslDGz3hnpVD8UpPxHXGyLxukN2y1Rwb6tKy3rE acA7mwdD8y2d2hhY0gbY1xZi7TlxVkho3+KQwqh0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([178.6.28.156]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mdf8F-1lMJRq0ruT-00Zew9; Mon, 21 Jun 2021 19:00:27 +0200 In-Reply-To: <87tuluyopg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 19 Jun 2021 15:21:47 +0200") X-Provags-ID: V03:K1:DNvPXj1n16msmDvnbvsziEYfVOKJprnOtoZWhuycKcyk5byj1R1 196E/xeVGs1ToHQLMcBRtz/zRlBtjsIDQUA7t78JIA/0q/9caNiEdRArVp9UcIbHr8QbRGG buJaZiIMpmDeMRIUNgO4zWBLrcGUsYzhFlDZwwA47JYK3wXmhq+PPu0YzUkGQVhkpNQXaJc wGAzVBcUqq2s92maspsAQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:GRkktEC3f0c=:gA/SGVlNbUIkeRZLtGg42H 6jVmste2+eOjhODJIjlCJuGb1BPpjn3RyaXcQ4rFVzh7FVsSDluCjNR/s+pEwxk2aovpxLuUs IA0bbtVu6JU6612Z/VcubrraIaDiXInKzaBQunNmJvMktyWsqcZjl1Ey827S/MgRny7DxU1fl jth/MPGiNc3SbDiCATd1MtiUZjVd4uYo4Zg+iBlN884+wGnDY+YIXa7uSWWDezC50QgEs2d1l X8M32bCfh9jNvjQVh3PS3J+HZTEwLiDlAbPiE5M8FkIbrzir360KSvCGoCJNlm3jVdESaa+7u EWYc1rbFnVhrR1iS83KgLXGvxI+4cjjRXx6/37tpjx5PWsDp3HrVR0QYhf2sssyHQ2afYFEn/ TuOWLFJE7I/SW2blx+sKCIfbpndozqv+6scyvC7snV49jTDT/rCztnIn96UApwdksknDWY0jW SF0J08/1z83jYfCYdM/Bi8euC8CpRIB57xqFTniIY6YqzZt+HY4SiPwx/8ctM1k8hi3ucPnrw IzIJZF4VwbMCJV50eB1Zvih9kahPCmY26r/6lFP4Yvxv5EHp73l/jt+OvIF3y6xDqd22+NyrA rLgXx+EAKOSpktEAJrPUf+fKQs+qDrvSM08sXlyPxCNmwo5fLk2UyRAM4HWkkkLE3wB4xrnW0 ZuG1cjuCpsPr3EREu0TIS6oODBWtqo1WReMr25KIFfGZzT38ptVpa9Gbp3UpaFubHEHPTl0Sx ztCFr2bisKYcWpmYADxZGnTXSr93+yMql25Per6d4o1FiE7UW+xKAJSwXlpFocHi/F+BZDY1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208826 Archived-At: Lars Ingebrigtsen writes: > I've now copied over that text to the doc string of bound-and-true-p. You now changed the text to this: > Return the value of symbol VAR if it is bound, else nil. > Note that if `lexical-binding' is in effect, this function isn't > meaningful if it refers to a lexically bound variable. If you want feedback: I found this new version confusing, although it's totally correct. Because in my mental model, `bound-and-true-p' just receives a variable (i.e. internally quotes), so how _can_ it even "refer" to the lexical variable at all? But it is true: #+begin_src emacs-lisp (let* ((a 1) (get-a (lambda () (list a (bound-and-true-p a))))) (dlet ((a 2)) (funcall get-a))) ;; -> (1 1), not (1 2) as one might expect #+end_src Everything became clear when I looked at the implementation ;-) Maybe we can further improve the text to something like "not meaningful in the scope of a lexical binding of the variable" or something like that? Thanks, Michael.