From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.devel Subject: Re: Allow underscore in non-binding clauses of `if-let*` and friends Date: Tue, 12 Nov 2024 21:13:14 +0100 Message-ID: <7230689b-25ad-4c1e-9f7b-27e0f57fba72@vodafonemail.de> References: <868qto4lr6.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1720"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Joost Kremers , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 12 21:14:51 2024 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 1tAxHn-0000KX-06 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Nov 2024 21:14:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAxGp-0005Sv-GI; Tue, 12 Nov 2024 15:13:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAxGj-0005Sd-Jv for emacs-devel@gnu.org; Tue, 12 Nov 2024 15:13:46 -0500 Original-Received: from mr3.vodafonemail.de ([145.253.228.163]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAxGh-0005xI-Kv for emacs-devel@gnu.org; Tue, 12 Nov 2024 15:13:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1731442415; bh=7aS9MEXFIqBjl1L5okIgpRZifV9Us9WMPNR26L+KvMk=; h=Message-ID:Date:User-Agent:Subject:To:References:From: Content-Language:In-Reply-To:Content-Type:From; b=RZ3n0Rida9P/gfYy3iRVi6IqIdizRypb0bB32G5cORfUgikONvBo7iQFHdeLoKFPL C0FBrJGU96efAB81LQOG+hSgveEl9sOI38ZMpKSWWGppeTw0yiMSMXVVkxvhYnuAzh 6jitMev52/rvjvrSswohem14C4no0Xb6Vxli5a2Y= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr3.vodafonemail.de (Postfix) with ESMTPS id 4XnyKW1CZWz2Jnx; Tue, 12 Nov 2024 20:13:35 +0000 (UTC) Original-Received: from [192.168.178.41] (port-92-196-62-16.dynamic.as20676.net [92.196.62.16]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4XnyKL6jLtz9059; Tue, 12 Nov 2024 20:13:23 +0000 (UTC) Content-Language: de-DE-frami, en-US In-Reply-To: <868qto4lr6.fsf@fastmail.fm> X-purgate-type: clean X-purgate: clean X-purgate-size: 1124 X-purgate-ID: 155817::1731442411-1F7FD477-43F2E4F7/0/0 Received-SPF: pass client-ip=145.253.228.163; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr3.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325436 Archived-At: On 2024-11-12 14:36, Joost Kremers wrote: > We already use underscore to mean "ignore this variable" in several > contexts, so this seems consistent. It also macro-expands to the same > code as the one without underscore, so it's not less efficient. Actually, in a recent master your snippet even expands to (let* ((s (and t (foo (some-computation)))) (s (and s (bar (some-other-computation)))) (baz (and s (y-or-n-p "Hi? ")))) (if baz (message "yes"))) with (uninterned) symbols s being used in place of `_'. Seems that Michael has already seen to that: commit e680827e814e155cf79175d87ff7c6ee3a08b69a Author: Michael Heerdegen Date: Fri Feb 16 22:07:18 2024 +0100 Don't warn about _ not left unused in if-let and alike The macro expansions did not leave a variable _ unused; this triggered an irritating compiler warning (bug#69108). * lisp/subr.el (internal--build-binding): Handle bindings of the form (_ EXPR) separately. And I might consider using underscores instead of alignment ...