From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master e910ef3: Improve bound-and-true-p doc string Date: Sun, 20 Jun 2021 13:51:29 +0200 Message-ID: <878s34vjni.fsf@gnus.org> References: <20210619132209.8197.66484@vcs0.savannah.gnu.org> <20210619132210.BA49B20B76@vcs0.savannah.gnu.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="33029"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 20 13:52:44 2021 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 1luw0K-0008Qr-1T for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Jun 2021 13:52:44 +0200 Original-Received: from localhost ([::1]:35958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luw0J-0007x8-33 for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Jun 2021 07:52:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luvzG-0006c2-JA for emacs-devel@gnu.org; Sun, 20 Jun 2021 07:51:38 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:53708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luvzF-00044Y-1A for emacs-devel@gnu.org; Sun, 20 Jun 2021 07:51:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=R5mfxaBSPWdp0Bzrvmbf9X0wdHVXA+mo12NyNJcQ2tY=; b=p2M16KG5YvZcfv5Xwpy/M82mD9 g6qSvXhari2fY+jT/k7OqXBMNUmTPKBn4m6xBfjG/n8E+inJxv7K5aJa4DsMx4kC0uUDAI5bbuzpC Qmn2atcH5u/meniDst1AvqShZWw2m1ataTlhgTtfhTU/1gfbcwW79L1OjOSKKquZZjOw=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luvz8-0001G8-0m; Sun, 20 Jun 2021 13:51:32 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAJ1BMVEX8/fnX2OTDrcDi YVzWEA6dcpyaqd9yjNRXYaFTZ7dHPVQhHR7///899rEfAAAAAWJLR0QMgbNRYwAAAAd0SU1FB+UG FAsvAbMo8uMAAAGcSURBVDjLhdFNbuIwFABgJ1Ss7bTybGkU9mnrA6DGFxgkqk5XZSTMtt3E5QKQ hFU3Q5kTuM4Fqvhy80w7SH5kNE+RkPzh92dCjpGQK4IjYpQMJClO4ELK61jm4gQGUsg8K7JRmGcw IQD+ywPIziUVBRwXchKAuJG3WS6kuB2EN4RPk0sa424zCZFDqxSBkFexHDGWXIbnsYT2z1n6naFz UcT+J8WJzooR6Y2I/u/guM95P7F/QsIY64WfyWUv8GmazvtqL8fVXd+NSKfTDe2Faar6Sgz1bByW +Gp+WM5mj2gw6sdW+uUuBD4HYGrxY1WXYSoFf0wWVb3f74IiEX8mUXJv32sMS4DxgzUbBIQrwu+t Net6j0BT1djOVAbBUKtF1TrbmBpNqPTbpnVd84FhudqXANuPCq2da822cMPaNX6K+XDrXAUQ7j3i lB+gww9CifKpWleHa4RYtgd4xxCtfFcAT/j5XgDa1plnBPy3+4RXBN8aD86ZX7j2X9jhCWGMBvoy +rRb13TmbVPiGnDDdtWuPJnDg6l3fiN/AHHUm84Ok5x1AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx LTA2LTIwVDExOjQ3OjAxKzAwOjAw5r/CWgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wNi0yMFQx MTo0NzowMSswMDowMJfieuYAAAAASUVORK5CYII= X-Now-Playing: Japan's _Quiet Life (1)_: "Fall In Love With Me" In-Reply-To: (Stefan Monnier's message of "Sat, 19 Jun 2021 13:52:10 -0400") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:270957 Archived-At: Stefan Monnier writes: > Hmm... the `boundp` indeed checks the binding of the dynvar of that > name, but the subsequent var reference will actually return the lexical > binding if there's one: > > (eval '(let ((sm-foo 4)) (set 'sm-foo 0) (bound-and-true-p sm-foo)) t) > => > 4 Oh yeah -- it's not really a meaningful function at all when referring to a lexically bound variable. I've now updated the doc string further. > I suspect that `boundp` should signal a warning when compiling such code > because using `boundp` or `bound-and-true-p` within the lexical scope of > a var with the same name seems like a good hint that the coder is > quite confused. Yes, sounds like a good idea. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no