Received: (at 81361) by debbugs.gnu.org; 9 Jul 2026 04:19:48 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 09 00:19:48 2026 Received: from localhost ([127.0.0.1]:49125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1whgEm-0004YH-69 for submit <at> debbugs.gnu.org; Thu, 09 Jul 2026 00:19:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38890) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <rms@HIDDEN>) id 1whgEk-0004Xy-7y for 81361 <at> debbugs.gnu.org; Thu, 09 Jul 2026 00:19:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <rms@HIDDEN>) id 1whgEd-00077z-46; Thu, 09 Jul 2026 00:19:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=uy6j1rxd5qAf36u3s0uh3+sy+86Ac3JRf5atgMgN3Pg=; b=TPLjqT0cnOfB rgMTS07eBL59ZmIzrOE9lsz5EB17HuvrklELyf7PzDEE3LVhd6EDNJaqqTy5ZxDe2Wk7GP7sQfgEK /x9bFihysbeGGDED06ySC7bbi4ucJ6lnSRzASCZgHHT3JnmmF/sXvL0DPrEiHNwEeah5enLrNkodo oSacZCJk/1AndLNjZGVEMr53ilJTXcwydf3rps3cSMtElRu1yKvc4bc7u1oIbbsApzKEjEHdTHOHX bG2FiFRIACZQKiWVAHkFwIEloQTxqj19DVbtA0/LvpgyCwJhwz1CWVoOyCIHS1otGsrhghO903lEn lC5lxJnWO41QjaHeU/kfrg==; Received: from rms by fencepost.gnu.org with local (Exim 4.93) (envelope-from <rms@HIDDEN>) id 1whgEW-007yJd-9o; Thu, 09 Jul 2026 00:19:33 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman <rms@HIDDEN> To: zach shaftel <zach@HIDDEN> In-Reply-To: <871pdebbq7.fsf@HIDDEN> (message from zach shaftel on Tue, 07 Jul 2026 19:50:56 -0400) Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond* References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN> <87jyr8r7mt.fsf@HIDDEN> <87a4s48eg5.fsf@HIDDEN> <878q7nrga1.fsf@HIDDEN> <87jyr6oqct.fsf@HIDDEN> <871pdebbq7.fsf@HIDDEN> Message-Id: <E1whgEW-007yJd-9o@HIDDEN> Date: Thu, 09 Jul 2026 00:19:32 -0400 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 81361 Cc: philipk@HIDDEN, 81361 <at> debbugs.gnu.org, spwhitton@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Reply-To: rms@HIDDEN Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I am still waiting to see a clear self-contained description of what bind-or* _does_. Other people seem to be having a discussion of this, and making some decisions, which I can't make sense of because I dont know what bind-or* is _meant_ to do! Would someone who understands the intended meaning PLEASE tell me now what that meaning is? And give me a chance to comment on it before you make a decision about it? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.Received: (at 81361-done) by debbugs.gnu.org; 8 Jul 2026 09:06:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 08 05:06:14 2026 Received: from localhost ([127.0.0.1]:37927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1whOEN-00046a-Kb for submit <at> debbugs.gnu.org; Wed, 08 Jul 2026 05:06:14 -0400 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]:36677) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>) id 1whOEK-00045I-5b for 81361-done <at> debbugs.gnu.org; Wed, 08 Jul 2026 05:06:09 -0400 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id D18AD14000E3; Wed, 8 Jul 2026 05:06:02 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 08 Jul 2026 05:06:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1783501562; x= 1783587962; bh=waf+q50fRFGck00ozlWq834yp9NUbaATa2YzcLcwojM=; b=U bRQdOqMEz2aC5Z1cJ6cjKXqtFR6eUVzBMoZ+bsD5tEn9gBw9mRIXP/N98ZRpJsPP 3Utl9qikTpHjRSO36YV8HyhBLIYBJD2keOxbIgQwJpGAtMJrcwif7TrILXcm3VQo fANQxpWJb0PyEeLAtlNnhORACOT1mmVat9stFzT/IFk3BK378rlvSq9pPtF1pOCh Bgpnnq+DW3Ybu3JsH5uygq84ixvaU571TuVadnjINjpQU7NwrIpIAVoLdHbycSZ2 le381aE91zVSJiaiEVC84qkFmMNxhv8vGh5/Co3ReB+E3k9tB3sbI41PmrMNm9C7 cMCbJy2T499NRiJEOw5yA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783501562; x=1783587962; bh=waf+q50fRFGck00ozlWq834yp9NUbaATa2Y zcLcwojM=; b=MEmhdZVPuwHZUJ5raHIhQAtiFpR9evp3SGXB/XqTzHdEvhnXeHD PWDXZSb+XLXNBPSMGpbfBXAe3UnDgYUaEW6g8hqqSjAN3ur/IIt8qw8efroX1g2u QNOw86a5vIl5aBLdpMM0p75PVvYiwfWzrn+saac/OGE2LV26+ICPsj/CNAS4TPrY mzLFq1gCTiyFWgO4S2MwZkL45zd3VZMzo83OfYDLzI5Vnep+FLGaM4+7hhOwu1r8 GwkGvjbqQFpnPDPuYcu3upev+91D3DRiTQpiyYOGe77xkSQOgOZ32PZSVdAcUZq+ dF4dL45hbtnvllpfS+B78eDoJO/f6sSVkBg== X-ME-Sender: <xms:-hJOakiwMkO1Y4VLe7k5RbYHNNKIpYU0-eBeA_HgWUByJScKqpXv1Q> <xme:-hJOakB_hHwfte4fRfQ8dX0NmZlzmVeNQYmce30yjIvmPDnK2EicyidKORRcs1lhQ cVMmXaYSoRRY-0Zh6mr9dTLOcr4SQ8ahz1iOg_ycTbhip5V_asY_tA> X-ME-Received: <xmr:-hJOahG8p0tU3OLOOb0mKIer_UyuFlCxeC99ss5AaTEhEfSW-xrmn-41B-afEPfjCpuvfFn2eurU> X-ME-Proxy-Cause: dmFkZTEOa+xwX0Zw064vvDyWnQmut7FHxirZVwvWQRKEIFsI0DpD3/FbS9i0EfxUq0Hfoj UIf9ErXvXMrBXH/IRrovLkpPmMIPYUVLGwqmUA8ZyruXEL8RZSEZFHf36hYZ+LjuZ5wbHv 4du/vB6ZdDx5lekstaEUFYA+4IXXJwj9nv6Ord/Knlv20bH1d21h+aFU5TOG3ZVvcEzrAw wE/SuLFdzvZNiNptcOuvoepMjBj49kPuzJm0/A+ppKFUaBK0tD9LlBdWT2JyPBhzXLEcZp nbY2+r4HHLKMdjpx8Z2PhWWA+zDBCUlAM2G+tXEqWPAsrbrv1HRoW/lgbLSJ6VjHpaKINS nQnwFMJzNWHNo+IIqrPcaxHHTb2cebFZSIMzXA2c833HqIBuA/upxStpNf5CVRRwjrdDOU MFe11GTpBBYuNPNLsaq5lFtIBlc+uc+AGMzaP9xc4nBqBn5JnvpjJm9d+McclGo2qKQKuD eWAIphDxEVvxMBpMi1wgYEliNC3U63wWPljJHKi7uVpULILpeOa98A99tdXDaiDxKx+KA+ 8jLj+JzrQ2jjCb9Lcy6X35MVAT+dXJMDTIpxWjUaH+wVUcBeJWtqJBAEFX7rrHPbnxw3/q X6xZM7pCTiwO7QsLr0xltIf91y7wyZwMXFQWyKHFiDZ6iGTy0cwmPY+nCc6w X-ME-Proxy: <xmx:-hJOakJnLuB1Xsnexje3ZQARr54CajzYvIP9aBnutvZe_UB5V132bw> <xmx:-hJOatl4oD7yGpfID75WK8yqbdmee6-ptPI8eXVwiviAoF5JNna0Ww> <xmx:-hJOakS4iLvM6VY7QTj4fQ_mgSfCqmZgFehm1FygdRvOErTk24qbQQ> <xmx:-hJOanKgXg3CigdGOM4pWhEsnJFPmBE_52r3imkf_fck7jwKuhJOHA> <xmx:-hJOakOZDoPxFPHQ8kWhyyK_4urLOC4mWOnUXcIPnhfKa9Klj31TLi1u> Feedback-ID: i62564b17:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jul 2026 05:06:01 -0400 (EDT) Received: by melete.silentflame.com (Postfix, from userid 1000) id 558277E2478; Wed, 08 Jul 2026 10:06:00 +0100 (BST) From: Sean Whitton <spwhitton@HIDDEN> To: zach shaftel <zach@HIDDEN> Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond* In-Reply-To: <871pdebbq7.fsf@HIDDEN> References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN> <87jyr8r7mt.fsf@HIDDEN> <87a4s48eg5.fsf@HIDDEN> <878q7nrga1.fsf@HIDDEN> <87jyr6oqct.fsf@HIDDEN> <871pdebbq7.fsf@HIDDEN> Date: Wed, 08 Jul 2026 10:06:00 +0100 Message-ID: <87y0fln953.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81361-done Cc: Philip Kaludercic <philipk@HIDDEN>, 81361-done <at> debbugs.gnu.org, rms@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) zach shaftel [07/Jul 7:50pm -04] wrote: > Sean Whitton <spwhitton@HIDDEN> writes: > >>> That said, this patch also implements bind-and* without the need for >>> throw/catch. Is there interest in integrating that into the existing >>> bind-and* implementation, or is it not worth rocking the boat? >> >> Yes, thanks. Can you make it a standalone patch? It's probably best to >> change the code inline instead of adding a helper, but you could add a >> helper if that doesn't work out well. >> >> Please CC Philip Kaludercic on your reply. Philip worked on trying to >> avoid throw/catch previously but didn't think there was a good way to do >> it, so he'll probably want to take a look. > > Done, see bug#81374. I CCed you, Philip and Richard. > > You can close this one now. Doing so. Btw, use X-debbugs-cc not Cc when writing to bug-gnu-emacs@. -- Sean Whitton
zach shaftel <zach@HIDDEN>:Sean Whitton <spwhitton@HIDDEN>:Received: (at 81361) by debbugs.gnu.org; 8 Jul 2026 04:26:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 08 00:26:28 2026 Received: from localhost ([127.0.0.1]:37231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1whJre-0004fy-Np for submit <at> debbugs.gnu.org; Wed, 08 Jul 2026 00:26:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53978) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <rms@HIDDEN>) id 1whJra-0004ep-0B for 81361 <at> debbugs.gnu.org; Wed, 08 Jul 2026 00:26:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <rms@HIDDEN>) id 1whJrU-0001mB-Bo; Wed, 08 Jul 2026 00:26:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=zil7F2aJI1nWJuIM1wzmmsof8PmcbZriq/BRqxzumHQ=; b=bOuufjqNPWqe U+LCCofmhVyxEtH65KESkW7acyJuv7hNIUpQKlviAuLRdopVXwXWyT7Q76EN948NNIxmON9IRF1Vo 34NX9WDDPuN99IKH98SeaTpv//rZepysL4f4w3FmFXtAFuNQMTrR7xt9f8Fyz0m5Bxn+YwDd3h8ip 94ZM33Mls1M5wLoawb5IgvtySuCOYfwwfuSWYHuJL3ezca2o01XhWRgqo2K76aYr2vT2rhZcTApc3 35gJKR7bPWcDlm2VL21rekG2ME8FxZsjzenIXGBjtKFQ/GPYOxRIZ6MFZQ5ZT4BxKDO+tvafomq23 r19SfU/byTyfsaQeCQ30XA==; Received: from rms by fencepost.gnu.org with local (Exim 4.93) (envelope-from <rms@HIDDEN>) id 1whJrS-001qlm-TG; Wed, 08 Jul 2026 00:26:14 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman <rms@HIDDEN> To: zach shaftel <zach@HIDDEN> In-Reply-To: <87jyr8r7mt.fsf@HIDDEN> (message from zach shaftel on Mon, 06 Jul 2026 01:48:10 -0400) Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond* References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN> <87jyr8r7mt.fsf@HIDDEN> Message-Id: <E1whJrS-001qlm-TG@HIDDEN> Date: Wed, 08 Jul 2026 00:26:14 -0400 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 81361 Cc: 81361 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Reply-To: rms@HIDDEN Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Thanks for showing us the code in both forms. To understand the uses of bind-or* I would need to see clear documentation of that construct, so I am waiting to see your documentation. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.Received: (at 81361) by debbugs.gnu.org; 7 Jul 2026 23:51:10 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 07 19:51:10 2026 Received: from localhost ([127.0.0.1]:36472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1whFZF-0007oG-Uu for submit <at> debbugs.gnu.org; Tue, 07 Jul 2026 19:51:10 -0400 Received: from smtp.forwardemail.net ([121.127.44.73]:7995) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <SRS0=648b=FC=shaf.tel=zach@HIDDEN>) id 1whFZB-0007mR-2I for 81361 <at> debbugs.gnu.org; Tue, 07 Jul 2026 19:51:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shaf.tel; h=Content-Type: MIME-Version: Message-ID: Date: References: In-Reply-To: Subject: Cc: To: From; q=dns/txt; s=fe-acc5b42812; t=1783468261; bh=iwm9M2KLWB++4Sdr71nCQLhpx7Ds1zW+jO2WHPdZ4Xo=; b=GtRXYoJflHc7f1SysoJBvQCVGtYl3NENGGAcTdGr4w7gi85KEe43agMZ5OxuFusJBh07KdESX rQJapYwZF6Gutb+AizqE+fnxcJwJlTrYXi+k6yAGo2REYYDsE5M7xC7Yo505T98dI1AJ14ozjZC YxYu9uL/efU4u7g128ue3eg= X-Forward-Email-ID: 6a4d90e1e65bccddd1a9ac91 X-Forward-Email-Sender: rfc822; zach@HIDDEN, smtp.forwardemail.net, 121.127.44.73 X-Forward-Email-Version: 2.10.0 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@HIDDEN X-Report-Abuse: abuse@HIDDEN X-Report-Abuse-To: abuse@HIDDEN From: zach shaftel <zach@HIDDEN> To: Sean Whitton <spwhitton@HIDDEN> Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond* In-Reply-To: <87jyr6oqct.fsf@HIDDEN> References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN> <87jyr8r7mt.fsf@HIDDEN> <87a4s48eg5.fsf@HIDDEN> <878q7nrga1.fsf@HIDDEN> <87jyr6oqct.fsf@HIDDEN> User-Agent: mu4e 1.14.1; emacs 32.0.50 Date: Tue, 07 Jul 2026 19:50:56 -0400 Message-ID: <871pdebbq7.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 81361 Cc: Philip Kaludercic <philipk@HIDDEN>, 81361 <at> debbugs.gnu.org, rms@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Sean Whitton <spwhitton@HIDDEN> writes: >> That said, this patch also implements bind-and* without the need for >> throw/catch. Is there interest in integrating that into the existing >> bind-and* implementation, or is it not worth rocking the boat? > > Yes, thanks. Can you make it a standalone patch? It's probably best to > change the code inline instead of adding a helper, but you could add a > helper if that doesn't work out well. > > Please CC Philip Kaludercic on your reply. Philip worked on trying to > avoid throw/catch previously but didn't think there was a good way to do > it, so he'll probably want to take a look. Done, see bug#81374. I CCed you, Philip and Richard. You can close this one now. - Zach
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.Received: (at 81361) by debbugs.gnu.org; 7 Jul 2026 13:56:50 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 07 09:56:50 2026 Received: from localhost ([127.0.0.1]:60531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1wh6I2-0003sQ-Gm for submit <at> debbugs.gnu.org; Tue, 07 Jul 2026 09:56:49 -0400 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]:57491) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>) id 1wh6Hx-0003qz-Gb for 81361 <at> debbugs.gnu.org; Tue, 07 Jul 2026 09:56:43 -0400 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 23E151400040; Tue, 7 Jul 2026 09:56:36 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 07 Jul 2026 09:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1783432596; x= 1783518996; bh=LIAsuSzaawasGLOzvxLbmg9G0aWXTx+oHsDeogVIHAA=; b=1 TbZGWhK6CC7GsKdSqshs3ySSoFz+ZjSeR/5O4EMqQ+DS+zh455V0ShFd/oZBGaVQ ugoDQarJptdl+5dcoMpfqVqDNNJRiUOwlyre5AFIHZUeClRXXSGCZDan4fEELMA6 G1vwQBAvXg5yjIyAoBCrzLgMu74gvyN3RCPShh1nGaQGrMLe34gtJ4IgPwSUvESz JFkdz2+zZ52HfZvaKBguqoFdVroLcH5HKi2+RT6MhQATCqkNn3KmKufeKXEJDgQK LioHXymG9apuhqci32safFh+upGm15KODxIbCGOC61O35Qh9GJPKUATlc+yyXbBQ hRgs8BLhbExjsRWLU+Uwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783432596; x=1783518996; bh=LIAsuSzaawasGLOzvxLbmg9G0aWXTx+oHsD eogVIHAA=; b=EXVXYz0IyNbdNo7qURvvIsb+rwFnslXhReLNms5fFZ+95+2o6/l 2WIltwCmaYGGV1ejN6zaGISN9FLg3hb4JPexaUVZeqpGks5Mwu5SDXe8F8XH8c3v ZOZvrFUlBMd4jl8UAgFtEDD8plWVBkiVTR0engHYvh8KNfpTpe3Jj0EGEBPJZZiy LYy5seed828Nnnh/O/0gYnac1rK1S9p6fO3//sVVWSC6Q3rPnvJmjHE59H3UTXqQ 5wPnBcVpJ1rjHSsHoVLMyu6tTqY7h8x3gD5wWf5XEJpZbw4T2hOSoyczoQIzXGQ9 P1B3fpZJhGn0tUnIZp5agMJ88B1en1QEUPw== X-ME-Sender: <xms:kwVNau1cB4qzEcT6Ty4iPbpq_P1zSTDeaVsDvvHIklbpsQ6SAvKGQg> <xme:kwVNaoh27USX4cu4LelQ0CSmJo-DaqOpzTVQpnWjD73lp_78kwIdadJFyycEG-55P CtzDN4igZktslKPa3qpzHSdVFXTAuIHGuVzcUn8s8aqF_ZGayf8Hdg> X-ME-Received: <xmr:kwVNakSwdxuywoVAC8UIhAB15MORxA7XSm8ruTj-tznQp5OfHZrogB1kZ9vzguSgWeH_1Ik-DSiH> X-ME-Proxy-Cause: dmFkZTFDhsk6mnWeduUdS0au4zf7C5r43w6SkrXOCcOEMsG2CG8UJrWVF995w5NCNim9mL zMbiu2Zl/ijlYCGJW4zQ0cpCbdu3iZFJnpPi+a8SchPOcwYFbuHTkXg1HE/w8SEO+gppOw Axqob4jhg5AtvqzklhanoZSiNWUpsGa+922WcJnIwI0CiuH31gkJ8LyQK5ycW+U2vcG1RR BiFGK1lknaYDwyoqpJLGhDuVptISD1FCa5MkerwU/jB2y6QbZsdjhTH0CDCOoJ/myzjwTS sWWASFk47/QhQzEr4CyibAZyDuhaziMJ9QeqNnsyfil+6s8Iprjsveep3Ft9iWz+lJmEai MbYZm24Q63H58jrYYoLcfXnnEILLIuRyVqiCNN0jyRfmlqutSsP5nq1VyjOEXCxyIYXhU1 LliuRXUQEkcm/s2xTgLbcSJkyiRKOag9ysIlAKNUtkIx+2Dc+zE+aRIubgAWZCpTj4W1E5 5aeQHJtoZg+5ieZEOhbXuVlbxgAjho67aEd/MmG600RokXzgogeIa8Q7vI689q8YgPOWpL qZDSTvHUQPqVSr6mA98hF7dMcg0gyYRMS8C+sU5QQpx/fkJdeRaEegf+1OvMrwOWPkV6Yh ipBdelF8rkOEG4agJ0z7XVeGaGxt1Ns2Q985RJAj6kBJdJInMePd1H8xfhHA X-ME-Proxy: <xmx:kwVNapiozZnUlaVhbAIboB1wGFt8ikWOruDixH8AObmvf1nmEIeO5w> <xmx:kwVNak7Uiui6RwfDFEtXnns_M2OdaPBkf0rfOwwQkgiAGEAMkHAseA> <xmx:kwVNamD6UyQB6MHsoMudXg6kt5uupashXLsE-JEUDcmn4cPytzH0JA> <xmx:kwVNarbkBmkk9KLJSqzPjDvLZlnTQMHWwLF4t56cFtwsSU2XYxC5Vw> <xmx:lAVNap7LUQqupsePTv5QcTbv9nz9wTkTTjWiqSZwT5PfkuKug4XtAy0m> Feedback-ID: i62564b17:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jul 2026 09:56:35 -0400 (EDT) Received: by melete.silentflame.com (Postfix, from userid 1000) id B8DAC7E9F96; Tue, 07 Jul 2026 14:56:34 +0100 (BST) From: Sean Whitton <spwhitton@HIDDEN> To: zach shaftel <zach@HIDDEN> Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond* In-Reply-To: <878q7nrga1.fsf@HIDDEN> References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN> <87jyr8r7mt.fsf@HIDDEN> <87a4s48eg5.fsf@HIDDEN> <878q7nrga1.fsf@HIDDEN> Date: Tue, 07 Jul 2026 14:56:34 +0100 Message-ID: <87jyr6oqct.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81361 Cc: 81361 <at> debbugs.gnu.org, rms@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) zach shaftel [06/Jul 4:53pm -04] wrote: >> I'm unsure about this. I'm concerned about readability. >> >> - feels unnatural, because normally there is a positive association >> between a set of bindings and the clause body > > This I understand, and I've been trying to think of other possible names > or forms of the construct that might feel more natural. bind-or* is for > symmetry with bind-and*. One format that makes more intuitive sense to my > mind is > (not (bind* ...)) > but I may be alone in that intuition. > >> >> - it breaks the rule that a set of bindings is scoped over all remaining >> clauses if and only if the bindings clause has no body. > > bind* does not obey this, its bindings are established around both its body > and all remaining clauses. Good point, though we would be introducing a clause type that's inconsistent in the extent of its bindings. For all the other types, the extent of the bindings is always determined just by the shape of the code, not any values at runtime, which aids readability. >> The second one seems serious to me. >> >> If it's a single binding, then >> >> ((bind* (var val))) >> ((not var) ELSE ...) >> >> is significantly preferable, I think. >> >> So the question is whether it is worth it for multiple bindings. >> >> I'd like to see more examples. Looking at the one you've provided so >> far, the nested cond that pushes a value and then returns nil seems like >> rather complex control flow that might not exemplify best practices. > > What do you mean exactly? Is > (or (intern-soft text gaudy-cl--package) > (ignore (push text gaudy-cl--unrecognized-symbols))) > preferable (which it is to me) or is something else about it > problematic? I don't think it's great for conditions on whether a block of code is going to get executed to have anything but the simplest side-effects, basically. > Looking over my other uses of bind-or*, most of them are single binding > cases. So on review, I agree with the readability concern and don't > think bind-or* would be a good addition after all. Okay cool, glad my feedback was useful. > That said, this patch also implements bind-and* without the need for > throw/catch. Is there interest in integrating that into the existing > bind-and* implementation, or is it not worth rocking the boat? Yes, thanks. Can you make it a standalone patch? It's probably best to change the code inline instead of adding a helper, but you could add a helper if that doesn't work out well. Please CC Philip Kaludercic on your reply. Philip worked on trying to avoid throw/catch previously but didn't think there was a good way to do it, so he'll probably want to take a look. -- Sean Whitton
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
Received: (at 81361) by debbugs.gnu.org; 6 Jul 2026 20:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 06 16:53:59 2026
Received: from localhost ([127.0.0.1]:56411 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wgqKB-0001ZX-EO
for submit <at> debbugs.gnu.org; Mon, 06 Jul 2026 16:53:58 -0400
Received: from smtp.forwardemail.net ([121.127.44.66]:12059)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2)
(envelope-from <SRS0=aee7=FB=shaf.tel=zach@HIDDEN>)
id 1wgqK5-0001Y1-MF
for 81361 <at> debbugs.gnu.org; Mon, 06 Jul 2026 16:53:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shaf.tel;
h=Content-Type: MIME-Version: Message-ID: Date: References: In-Reply-To:
Subject: Cc: To: From; q=dns/txt; s=fe-acc5b42812; t=1783371226;
bh=h3AfDYY730XGLYWBW7mQQnzIcB4q4BLaPzJyi0mOHPE=;
b=pVrEXcQ8WVQUg4+eavoEiXGrbwSsR0AqQLQj9bEJHzUu+tEs8viSjKm+b/M9hReMCCv2RSwf7
DqsHqoDMnMn1Fxbi9/iKnSmBFbCtob+6mGSRGBztbnVSOcbsFqHcBFzvtJMmHHVFq9jDWsamuhs
o8YuzBs9FO2+u0G7EipR940=
X-Forward-Email-ID: 6a4c15d76543b4109ebdef64
X-Forward-Email-Sender: rfc822; zach@HIDDEN, smtp.forwardemail.net,
121.127.44.66
X-Forward-Email-Version: 2.9.7
X-Forward-Email-Website: https://forwardemail.net
X-Complaints-To: abuse@HIDDEN
X-Report-Abuse: abuse@HIDDEN
X-Report-Abuse-To: abuse@HIDDEN
From: zach shaftel <zach@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond*
In-Reply-To: <87a4s48eg5.fsf@HIDDEN>
References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN>
<87jyr8r7mt.fsf@HIDDEN> <87a4s48eg5.fsf@HIDDEN>
User-Agent: mu4e 1.14.1; emacs 32.0.50
Date: Mon, 06 Jul 2026 16:53:42 -0400
Message-ID: <878q7nrga1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 81361
Cc: 81361 <at> debbugs.gnu.org, rms@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Sean Whitton <spwhitton@HIDDEN> writes:
> zach shaftel via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" [06/Jul 1:48am -04] wrote:
>> Sure. I'm not sure the best format to share it so I'll just include the
>> code inline. Here is the original expression:
>>
>> (if-let* ((head (gaudy-cl--head node))
>> (child (gaudy-cl--unwrap head qdepth))
>> (_ (string= (treesit-node-type child) "interned_symbol"))
>> (operator (let ((text (gaudy-cl--node-text child)))
>> (cond
>> ((intern-soft text gaudy-cl--package))
>> (t (push text gaudy-cl--unrecognized-symbols)
>> nil))))
>> (real-sym (symbol-function operator)))
>> (if-let* ((local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
>> (progn
>> (gaudy-cl-reference-local child local)
>> (gaudy-cl-do-nodes (:following arg head)
>> (gaudy-cl-walk arg)))
>> (let ((ftype (get real-sym :definition))
>> (handler (symbol-function real-sym)))
>> (pcase ftype
>> (:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
>> (:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
>> (:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator)))
>> (cond*
>> (handler (funcall handler head))
>> ((or (plusp qdepth) (eq ftype :function))
>> (gaudy-cl-do-nodes (:following child head)
>> (gaudy-cl--walk child nil qdepth)))
>> ((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
>> (body-pos (get real-sym :body)))
>> (gaudy-cl--walk-body
>> (gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))))
>> (when (plusp qdepth)
>> (gaudy-cl-do-nodes (:siblings child head)
>> (gaudy-cl--walk child nil qdepth))))
>>
>> Here is the cond* form with bind-or*:
>>
>> (cond*
>> ((bind-or* (head (gaudy-cl--head node))) nil) ;empty list, who cares
>> ((bind-or* (child (gaudy-cl--unwrap head qdepth))
>> (_ (string= (treesit-node-type child) "interned_symbol"))
>> (operator (let ((text (gaudy-cl--node-text child)))
>> (cond
>> ((intern-soft text gaudy-cl--package))
>> (t (push text gaudy-cl--unrecognized-symbols)
>> nil))))
>> (real-sym (symbol-function operator)))
>> (when (plusp qdepth)
>> (gaudy-cl-do-nodes (:siblings child head)
>> (gaudy-cl--walk child nil qdepth))))
>> ((bind-and* (local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
>> (gaudy-cl-reference-local child local)
>> (gaudy-cl-do-nodes (:following arg head)
>> (gaudy-cl-walk arg)))
>> ((bind* (ftype (get real-sym :definition))))
>> (t (pcase ftype
>> (:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
>> (:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
>> (:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator))))
>> ((bind-and* (handler (symbol-function real-sym)))
>> (funcall handler head))
>> ((or (plusp qdepth) (eq ftype :function))
>> (gaudy-cl-do-nodes (:following child head)
>> (gaudy-cl--walk child nil qdepth)))
>> ((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
>> (body-pos (get real-sym :body)))
>> (gaudy-cl--walk-body (gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))
>>
>> In the case of a single binding, bind-or* is roughly equivalent to
>>
>> (cond* ((bind* (var val)))
>> ((not var) ELSE...)
>> ...)
>>
>> but when there are multiple bindings, you get the if-let* behavior of
>> short circuiting evaluation on the first nil value. And with bind-or*,
>> VAR would not be in scope around ELSE.
>>
>> I'd be happy to show more examples. After converting a few other
>> expressions in the same package, I actually ended up using bind-or*
>> slightly more than bind-and*, which surprised me.
>
> I'm unsure about this. I'm concerned about readability.
>
> - feels unnatural, because normally there is a positive association
> between a set of bindings and the clause body
This I understand, and I've been trying to think of other possible names
or forms of the construct that might feel more natural. bind-or* is for
symmetry with bind-and*. One format that makes more intuitive sense to my
mind is
(not (bind* ...))
but I may be alone in that intuition.
>
> - it breaks the rule that a set of bindings is scoped over all remaining
> clauses if and only if the bindings clause has no body.
bind* does not obey this, its bindings are established around both its body
and all remaining clauses.
> The second one seems serious to me.
>
> If it's a single binding, then
>
> ((bind* (var val)))
> ((not var) ELSE ...)
>
> is significantly preferable, I think.
>
> So the question is whether it is worth it for multiple bindings.
>
> I'd like to see more examples. Looking at the one you've provided so
> far, the nested cond that pushes a value and then returns nil seems like
> rather complex control flow that might not exemplify best practices.
What do you mean exactly? Is
(or (intern-soft text gaudy-cl--package)
(ignore (push text gaudy-cl--unrecognized-symbols)))
preferable (which it is to me) or is something else about it
problematic?
Looking over my other uses of bind-or*, most of them are single binding
cases. So on review, I agree with the readability concern and don't
think bind-or* would be a good addition after all.
That said, this patch also implements bind-and* without the need for
throw/catch. Is there interest in integrating that into the existing
bind-and* implementation, or is it not worth rocking the boat?
- Zach
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
Received: (at 81361) by debbugs.gnu.org; 6 Jul 2026 12:56:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 06 08:56:11 2026
Received: from localhost ([127.0.0.1]:53155 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wgirn-0000br-UH
for submit <at> debbugs.gnu.org; Mon, 06 Jul 2026 08:56:11 -0400
Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]:40807)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
id 1wgirh-0000aP-7v
for 81361 <at> debbugs.gnu.org; Mon, 06 Jul 2026 08:56:05 -0400
Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50])
by mailfout.stl.internal (Postfix) with ESMTP id AF1111D000C3;
Mon, 6 Jul 2026 08:55:55 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
by phl-compute-10.internal (MEProxy); Mon, 06 Jul 2026 08:55:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
h=cc:cc:content-type:content-type:date:date:from:from
:in-reply-to:in-reply-to:message-id:mime-version:references
:reply-to:subject:subject:to:to; s=fm1; t=1783342555; x=
1783428955; bh=oPyH+OV2347h3NMVL6lEgEHy3LnLyDuh/nV6D8W584s=; b=u
I2CS4NnOEaNwhPxb6O/HbdA8VQ94xA+z24ADD19LFlfN87gdc5byKCs76eTo2w4/
7ngE75LMpEjVPt1nSdUR80UV43VVqay6ZmqXQcMI8EeATtbtq74wF0MHY2gBI+T3
2lMcu2LIDsrFv3JcrinqCEE5cElh3lxAc/f6J6svwSFezDsY17Zedi7bQHovW0Ms
Cb/59VrkFsaS0BKAL9Rw77X58AUU3B2sw8WS7PJyPSkaNVNWvBZeHvGEddnAw/n4
XWQB8kcy1LWAOf9oybqFKqryETkhRxoi2ggthd0j00VSe6wrH753VHBwLT8oKwHX
Lv/cw/kZAzCDfOZW3RkYQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:cc:content-type:content-type:date:date
:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
:message-id:mime-version:references:reply-to:subject:subject:to
:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
1783342555; x=1783428955; bh=oPyH+OV2347h3NMVL6lEgEHy3LnLyDuh/nV
6D8W584s=; b=cbpz6wxz4gL7IC+MRFDdPC03b/y87dmaX6dGT3WcU21lkizONQT
sRBz6uWdQq4ojCj1HicwY45sagJRhDoGBpVtq9b6GduX0L+ENqHXsxCwEn3Mk7By
wTWoWlL1W4RItOvZQL68iieoTodBmu5hiHxrL5bLBDdNEm8Hp8KQpSUpZHExBCvj
qT+ElRocmVD9bVSUvi6niHveds6ACKdbX0tGA9YhY6PfhQrKM4Y0xoQHgT+T7qax
YGTO3RFx+lXiv5axWPxCS94iXHDArIsL28k+o9bWBqz+xumVjQ6yN/fqQfP8nIE9
tOteeMXeF3aCaIOmfyUtnPQjIAAWgCyf/tA==
X-ME-Sender: <xms:26VLagiCCMpsDn6DDOzWZdFuOt_2TaFWPv_Buj2ZGVxNqn3EAfMqOg>
<xme:26VLageFpCsbdG5XBgYTKlkH8txZ_U2pOcxdBzCtPBR32aELSQFpxNKk4f_Eu2IKr
c5CkZzdnhgYPNeC3xcUxvgn9PxR5J07Mgz7lpn4GyFKThnsHfxhz-E>
X-ME-Received: <xmr:26VLalf2gk0qtwtjqRv_X43UB_mWWQzXDh_dHy38Z6uRUWXd-6yd_Zdq1ZQH6Hy52thzRBb3qZd_>
X-ME-Proxy-Cause: dmFkZTGW7vnWIJFdPgf7ZqFHWpAfd6IpqMc4S1j/W/PWA5YiDmvptJcEqsWuFpNsBWqSFd
Bhy3rRPHMu34HhR0KLh7OxuUtDK0R7lyWA75gpLs2oAFAod8YmbAs9xCtmAXs6W91k6ZqZ
TWUknuPpnFRbQY1c5iqfYvk/SMWHaZGpZbl3QWRKWlTWPTMyoKAR9GIvmElb8cLgpwj+sx
IGlchk9pfoP5vPOsqXLdgcU15syzKVfxg6oc1yAmjnFy1CotNjfxQHyMtEGSdMXKYpG9OL
MekXXCxZs2PbcOFjzMOHIVpO23trJhozvz1wQsIJnNi0+mwtlzdmKZ65i/R75IkJDJ1DbW
RWQ6ah+N3TrM8iCU48gUzcFVC7e32ZdjBemOK4yFq7Z5Evg6IzYWefbOZsqTrTyFEHtg09
RTNJt+YFVBo97P7iQhjEKwOePCvrXsZgNJGY+Pp87uXcxugsVxvZB5kHAtt38jf+/FXU3B
xuy6jVCd+0Kv4uleRsoOikwSr++PqVuHugK0e1LEXyA88auK25B5+pvgSdDikQWkzkwasD
ztDMWtSWXs+hWw+EzZvsObDp+Ps/Nvw7dcer6eL5TnF8IXdpRWA87MVukxTpkWSumMUb2P
kNw/CjoT1Sv1esh2ame/t444iXyXtKSh2yhL6fkt+1RJlvSkJd5Rg57CTR9A
X-ME-Proxy: <xmx:26VLaq-QEx143X8AbxsZfgsWWPMOBYZpWXyJuwo-Gpx5QJJi6W6VVQ>
<xmx:26VLahlQB4N36iQf5VboUKvmFdhGcytIW-ddhE9HfF4ipkRHVJwGJg>
<xmx:26VLas8RsetScqPHCOnUXlsTtpgsyI6zTSNfBWfPNRR8BVMwQtvOag>
<xmx:26VLavmYC8ufgTx8hu5vVSz7HtStcsnCSoWyUiGX55ENy91ZXZdZcA>
<xmx:26VLao1G0g3bX3D03ZqaGiHA9564A_INAJP0j-pGr1te7ApOKvfvuY7k>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
6 Jul 2026 08:55:55 -0400 (EDT)
Received: by melete.silentflame.com (Postfix, from userid 1000)
id 3E0427E6A5C; Mon, 06 Jul 2026 13:55:54 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: zach shaftel <zach@HIDDEN>, rms@HIDDEN
Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond*
In-Reply-To: <87jyr8r7mt.fsf@HIDDEN>
References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN>
<87jyr8r7mt.fsf@HIDDEN>
Date: Mon, 06 Jul 2026 13:55:54 +0100
Message-ID: <87a4s48eg5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81361
Cc: 81361 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)
zach shaftel via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [06/Jul 1:48am -04] wrote:
> Sure. I'm not sure the best format to share it so I'll just include the
> code inline. Here is the original expression:
>
> (if-let* ((head (gaudy-cl--head node))
> (child (gaudy-cl--unwrap head qdepth))
> (_ (string= (treesit-node-type child) "interned_symbol"))
> (operator (let ((text (gaudy-cl--node-text child)))
> (cond
> ((intern-soft text gaudy-cl--package))
> (t (push text gaudy-cl--unrecognized-symbols)
> nil))))
> (real-sym (symbol-function operator)))
> (if-let* ((local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
> (progn
> (gaudy-cl-reference-local child local)
> (gaudy-cl-do-nodes (:following arg head)
> (gaudy-cl-walk arg)))
> (let ((ftype (get real-sym :definition))
> (handler (symbol-function real-sym)))
> (pcase ftype
> (:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
> (:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
> (:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator)))
> (cond*
> (handler (funcall handler head))
> ((or (plusp qdepth) (eq ftype :function))
> (gaudy-cl-do-nodes (:following child head)
> (gaudy-cl--walk child nil qdepth)))
> ((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
> (body-pos (get real-sym :body)))
> (gaudy-cl--walk-body
> (gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))))
> (when (plusp qdepth)
> (gaudy-cl-do-nodes (:siblings child head)
> (gaudy-cl--walk child nil qdepth))))
>
> Here is the cond* form with bind-or*:
>
> (cond*
> ((bind-or* (head (gaudy-cl--head node))) nil) ;empty list, who cares
> ((bind-or* (child (gaudy-cl--unwrap head qdepth))
> (_ (string= (treesit-node-type child) "interned_symbol"))
> (operator (let ((text (gaudy-cl--node-text child)))
> (cond
> ((intern-soft text gaudy-cl--package))
> (t (push text gaudy-cl--unrecognized-symbols)
> nil))))
> (real-sym (symbol-function operator)))
> (when (plusp qdepth)
> (gaudy-cl-do-nodes (:siblings child head)
> (gaudy-cl--walk child nil qdepth))))
> ((bind-and* (local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
> (gaudy-cl-reference-local child local)
> (gaudy-cl-do-nodes (:following arg head)
> (gaudy-cl-walk arg)))
> ((bind* (ftype (get real-sym :definition))))
> (t (pcase ftype
> (:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
> (:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
> (:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator))))
> ((bind-and* (handler (symbol-function real-sym)))
> (funcall handler head))
> ((or (plusp qdepth) (eq ftype :function))
> (gaudy-cl-do-nodes (:following child head)
> (gaudy-cl--walk child nil qdepth)))
> ((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
> (body-pos (get real-sym :body)))
> (gaudy-cl--walk-body (gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))
>
> In the case of a single binding, bind-or* is roughly equivalent to
>
> (cond* ((bind* (var val)))
> ((not var) ELSE...)
> ...)
>
> but when there are multiple bindings, you get the if-let* behavior of
> short circuiting evaluation on the first nil value. And with bind-or*,
> VAR would not be in scope around ELSE.
>
> I'd be happy to show more examples. After converting a few other
> expressions in the same package, I actually ended up using bind-or*
> slightly more than bind-and*, which surprised me.
I'm unsure about this. I'm concerned about readability.
- feels unnatural, because normally there is a positive association
between a set of bindings and the clause body
- it breaks the rule that a set of bindings is scoped over all remaining
clauses if and only if the bindings clause has no body.
The second one seems serious to me.
If it's a single binding, then
((bind* (var val)))
((not var) ELSE ...)
is significantly preferable, I think.
So the question is whether it is worth it for multiple bindings.
I'd like to see more examples. Looking at the one you've provided so
far, the nested cond that pushes a value and then returns nil seems like
rather complex control flow that might not exemplify best practices.
--
Sean Whitton
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
Received: (at 81361) by debbugs.gnu.org; 6 Jul 2026 05:48:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 06 01:48:30 2026
Received: from localhost ([127.0.0.1]:50897 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wgcBt-0008Ue-Vy
for submit <at> debbugs.gnu.org; Mon, 06 Jul 2026 01:48:30 -0400
Received: from smtp.forwardemail.net ([121.127.44.73]:32481)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.84_2)
(envelope-from <SRS0=2b12=FA=shaf.tel=zach@HIDDEN>)
id 1wgcBo-0008TA-Cq
for 81361 <at> debbugs.gnu.org; Mon, 06 Jul 2026 01:48:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shaf.tel;
h=Content-Type: MIME-Version: Message-ID: Date: References: In-Reply-To:
Subject: Cc: To: From; q=dns/txt; s=fe-acc5b42812; t=1783316896;
bh=/NxmBgAop4IWzPgNASWdIX+c/NeTHIg93ACqwiOOQCs=;
b=fnafIK4R24V6Y+4auIxncWR1XyzB8S6rI/7foeaRf0CabwB+Tv5Jkrqbef9WRYdFOzvnL3ftM
P73m3jNAtSlT5c0FOSJwoHxsJQsWyETUJVyQxon4IpHWt7BruWO//a0lmpzJR/G8Ok/xirb/7l9
oQPAhljQy1b4aVjWWt8fP+U=
X-Forward-Email-ID: 6a4b419b741c588b7038a902
X-Forward-Email-Sender: rfc822; zach@HIDDEN, smtp.forwardemail.net,
121.127.44.73
X-Forward-Email-Version: 2.9.7
X-Forward-Email-Website: https://forwardemail.net
X-Complaints-To: abuse@HIDDEN
X-Report-Abuse: abuse@HIDDEN
X-Report-Abuse-To: abuse@HIDDEN
From: zach shaftel <zach@HIDDEN>
To: rms@HIDDEN
Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond*
In-Reply-To: <E1wgawU-004X6A-3q@HIDDEN>
References: <87se5yqini.fsf@HIDDEN> <E1wgawU-004X6A-3q@HIDDEN>
User-Agent: mu4e 1.14.1; emacs 32.0.50
Date: Mon, 06 Jul 2026 01:48:10 -0400
Message-ID: <87jyr8r7mt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 81361
Cc: 81361 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Richard Stallman <rms@HIDDEN> writes:
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Looking at this, I don't understand what it concretely means.
>
> > +@code{(bind-or* @var{bindings}@dots{})} is like @code{bind-and*}, but
> > +the bindings are established only around the @emph{following}
> > +clauses.
>
> Would you please write the documentation of bind-or* in self-contained form,
> one which is easier to understand because it avoids being terse?
Rereading it now I agree, the current patch's documentation is
lackluster. I'll clarify it and submit an updated patch.
> Also, could you show this example, in both the original form
> and the modified form, so we can see the improvement?
>
> With
> > this I was able to convert a mess of nested if-let*/let*/cond forms into
> > a single cond* form, which is very satisfying.
Sure. I'm not sure the best format to share it so I'll just include the
code inline. Here is the original expression:
(if-let* ((head (gaudy-cl--head node))
(child (gaudy-cl--unwrap head qdepth))
(_ (string= (treesit-node-type child) "interned_symbol"))
(operator (let ((text (gaudy-cl--node-text child)))
(cond
((intern-soft text gaudy-cl--package))
(t (push text gaudy-cl--unrecognized-symbols)
nil))))
(real-sym (symbol-function operator)))
(if-let* ((local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
(progn
(gaudy-cl-reference-local child local)
(gaudy-cl-do-nodes (:following arg head)
(gaudy-cl-walk arg)))
(let ((ftype (get real-sym :definition))
(handler (symbol-function real-sym)))
(pcase ftype
(:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
(:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
(:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator)))
(cond*
(handler (funcall handler head))
((or (plusp qdepth) (eq ftype :function))
(gaudy-cl-do-nodes (:following child head)
(gaudy-cl--walk child nil qdepth)))
((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
(body-pos (get real-sym :body)))
(gaudy-cl--walk-body
(gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))))
(when (plusp qdepth)
(gaudy-cl-do-nodes (:siblings child head)
(gaudy-cl--walk child nil qdepth))))
Here is the cond* form with bind-or*:
(cond*
((bind-or* (head (gaudy-cl--head node))) nil) ;empty list, who cares
((bind-or* (child (gaudy-cl--unwrap head qdepth))
(_ (string= (treesit-node-type child) "interned_symbol"))
(operator (let ((text (gaudy-cl--node-text child)))
(cond
((intern-soft text gaudy-cl--package))
(t (push text gaudy-cl--unrecognized-symbols)
nil))))
(real-sym (symbol-function operator)))
(when (plusp qdepth)
(gaudy-cl-do-nodes (:siblings child head)
(gaudy-cl--walk child nil qdepth))))
((bind-and* (local (assq real-sym (cddr (assq :functions gaudy-cl-locals)))))
(gaudy-cl-reference-local child local)
(gaudy-cl-do-nodes (:following arg head)
(gaudy-cl-walk arg)))
((bind* (ftype (get real-sym :definition))))
(t (pcase ftype
(:function (gaudy-cl-fontify-node child 'font-lock-function-call-face))
(:macro (gaudy-cl-fontify-node child 'gaudy-cl-macro))
(:special (gaudy-cl-fontify-node child 'gaudy-cl-special-operator))))
((bind-and* (handler (symbol-function real-sym)))
(funcall handler head))
((or (plusp qdepth) (eq ftype :function))
(gaudy-cl-do-nodes (:following child head)
(gaudy-cl--walk child nil qdepth)))
((bind-and* (_ gaudy-cl-guess-spec-from-lambda-list)
(body-pos (get real-sym :body)))
(gaudy-cl--walk-body (gaudy-cl--nth-sexp-sibling (1+ body-pos) child))))
In the case of a single binding, bind-or* is roughly equivalent to
(cond* ((bind* (var val)))
((not var) ELSE...)
...)
but when there are multiple bindings, you get the if-let* behavior of
short circuiting evaluation on the first nil value. And with bind-or*,
VAR would not be in scope around ELSE.
I'd be happy to show more examples. After converting a few other
expressions in the same package, I actually ended up using bind-or*
slightly more than bind-and*, which surprised me.
- Zach
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
Received: (at 81361) by debbugs.gnu.org; 6 Jul 2026 04:28:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 06 00:28:37 2026
Received: from localhost ([127.0.0.1]:50707 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wgawe-00052U-5u
for submit <at> debbugs.gnu.org; Mon, 06 Jul 2026 00:28:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57762)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <rms@HIDDEN>) id 1wgawb-000514-GM
for 81361 <at> debbugs.gnu.org; Mon, 06 Jul 2026 00:28:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <rms@HIDDEN>)
id 1wgawW-00031J-3y; Mon, 06 Jul 2026 00:28:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
mime-version; bh=WsL4Z8/g9seuTGnUe47Rvc9BOx97kOOotpiat+lcpjw=; b=MVMP6B/VZ6Sr
au2pDT3fMWngT3Vvo8npXHtpeoORcuRaUNcALDeoIMP8vXSJa3Alh5r3FJiO4xHAU/jqQSJdoM1qV
MHjH4UQgreoOZW6Uo6iFrGsmd182ZW53SSwoJnJVp/7x+OhhvP+6Xmeg9v4AIw6Z6UFHOPaAysGqA
EUJQIOm/rPWptDctIWa27V2bsmD3SRVVPaRjgGHY1eRkburuHDwOv5Ms1ta4JfVUGk0jEYsjJRnHa
/Ee+KiNXRadCk7/ov3ZsLe2lr81VMRz6upZEAPl22MNNcuhyFdwDQqdlxEXG9ivNzXfkuVmtaMhwO
rwULUnAgqnU+JtsvcYlmFw==;
Received: from rms by fencepost.gnu.org with local (Exim 4.93)
(envelope-from <rms@HIDDEN>)
id 1wgawU-004X6A-3q; Mon, 06 Jul 2026 00:28:26 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: zach shaftel <zach@HIDDEN>
In-Reply-To: <87se5yqini.fsf@HIDDEN> (message from zach shaftel on Sat, 04
Jul 2026 22:23:13 -0400)
Subject: Re: bug#81361: [PATCH] Add bind-or* form to cond*
References: <87se5yqini.fsf@HIDDEN>
Message-Id: <E1wgawU-004X6A-3q@HIDDEN>
Date: Mon, 06 Jul 2026 00:28:26 -0400
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81361
Cc: 81361 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Looking at this, I don't understand what it concretely means.
> +@code{(bind-or* @var{bindings}@dots{})} is like @code{bind-and*}, but
> +the bindings are established only around the @emph{following}
> +clauses.
Would you please write the documentation of bind-or* in self-contained form,
one which is easier to understand because it avoids being terse?
Also, could you show this example, in both the original form
and the modified form, so we can see the improvement?
With
> this I was able to convert a mess of nested if-let*/let*/cond forms into
> a single cond* form, which is very satisfying.
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 5 Jul 2026 02:23:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 04 22:23:38 2026
Received: from localhost ([127.0.0.1]:60758 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wgCW6-0000y5-Sc
for submit <at> debbugs.gnu.org; Sat, 04 Jul 2026 22:23:38 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:32792)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2)
(envelope-from <SRS0=ee41=E7=shaf.tel=zach@HIDDEN>)
id 1wgCW1-0000wZ-88
for submit <at> debbugs.gnu.org; Sat, 04 Jul 2026 22:23:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1)
(envelope-from <SRS0=ee41=E7=shaf.tel=zach@HIDDEN>)
id 1wgCVv-0005pi-CD
for bug-gnu-emacs@HIDDEN; Sat, 04 Jul 2026 22:23:23 -0400
Received: from smtp.forwardemail.net ([121.127.44.73])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1)
(envelope-from <SRS0=ee41=E7=shaf.tel=zach@HIDDEN>)
id 1wgCVt-0002QA-DG
for bug-gnu-emacs@HIDDEN; Sat, 04 Jul 2026 22:23:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shaf.tel;
h=Content-Type: MIME-Version: Message-ID: Date: Subject: To: From;
q=dns/txt; s=fe-acc5b42812; t=1783218199;
bh=4XSqfxUwX6YZzhcCZeOvev2J86V4ceKRdP4INsIxbT8=;
b=g/XIP7SxhM2iP+8zogVz1uTBIiFyo4oElDG1L4/xEmoqPq4ajBuYIiLuyeylGS4EtuYS0U/5s
Io+tHbWChxhjRTN1qYsRDqVhifvCebE2KXMW2zbfEovQOqKifcV/HAYdCOJhDMC9mUcLJ9Xq23O
SLFlRpiPsBc4GWXfyrn5Ydk=
X-Forward-Email-ID: 6a49c013bd71227f268fabe9
X-Forward-Email-Sender: rfc822; zach@HIDDEN, smtp.forwardemail.net,
121.127.44.73
X-Forward-Email-Version: 2.9.6
X-Forward-Email-Website: https://forwardemail.net
X-Complaints-To: abuse@HIDDEN
X-Report-Abuse: abuse@HIDDEN
X-Report-Abuse-To: abuse@HIDDEN
From: zach shaftel <zach@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Add bind-or* form to cond*
User-Agent: mu4e 1.14.1; emacs 32.0.50
X-Debbugs-Cc: Richard Stallman <rms@HIDDEN>
Date: Sat, 04 Jul 2026 22:23:13 -0400
Message-ID: <87se5yqini.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=121.127.44.73;
envelope-from=SRS0=ee41=E7=shaf.tel=zach@HIDDEN;
helo=smtp.forwardemail.net
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, SPF_HELO_PASS=-0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)
--=-=-=
Content-Type: text/plain
This is like bind-and*, but flipped: if the binds are all non-nil,
continue to the next clause; otherwise, run the clause's body. Like
bind-and*, the bindings are only established around the code where all
the values are non-nil.
I found myself wanting this construct just as often as bind-and*. With
this I was able to convert a mess of nested if-let*/let*/cond forms into
a single cond* form, which is very satisfying.
-Zach
In GNU Emacs 32.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.52, cairo version 1.18.4) of 2026-06-26 built on arch-thinkpad
Repository revision: 98f3bfe7e1cbd8bc43fcfd62bf985471aa255e34
Repository branch: master
System Description: Arch Linux
Configured using:
'configure --with-pgtk --with-native-compilation --with-tree-sitter
--with-modules --without-gconf --without-gsettings --with-rsvg
--without-compress-install 'CFLAGS=-O2 -g -mtune=native -march=native
-fuse-ld=mold' 'CC=ccache gcc''
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
filename=0001-Add-bind-or-form-to-cond.patch
From 4335c334abf5118b9d0e73cda61250bd61e8c101 Mon Sep 17 00:00:00 2001
From: Zach Shaftel <zach@HIDDEN>
Date: Sat, 4 Jul 2026 21:56:37 -0400
Subject: [PATCH] Add bind-or* form to cond*
This is effectively the inverse of bind-and*: evaluate the clause's body
if any bindings are nil, otherwise establish the bindings around the
remaining clauses.
* lisp/emacs-lisp/cond-star.el (cond*-convert-bind-conditional): New
helper function to expand both bind-and* and bind-or* clauses.
(cond*-convert-condition): Use cond*-convert-bind-conditional.
(cond*, bind-or*): Document it.
* doc/lispref/control.texi (cond* Macro): Document it.
---
doc/lispref/control.texi | 14 +++--
lisp/emacs-lisp/cond-star.el | 103 ++++++++++++++++++++++++++---------
2 files changed, 86 insertions(+), 31 deletions(-)
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index d3662f727cc..6226b425f53 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1529,10 +1529,10 @@ cond* Macro
@defmac cond* &rest clauses
The @code{cond*} macro is an extended form of the traditional
@code{cond}. A @code{cond*} expression contains a series of
-@var{clauses}, each of which can use @code{bind*} or @code{bind-and*} to
-specify binding variables, use @code{match*} or @code{pcase*} to specify
-matching a pattern as a condition, or specify an expression as a
-condition to evaluate as a test.
+@var{clauses}, each of which can use @code{bind*}, @code{bind-and*} or
+@code{bind-or*} to specify binding variables, use @code{match*} or
+@code{pcase*} to specify matching a pattern as a condition, or specify
+an expression as a condition to evaluate as a test.
Each clause normally has the form @w{@code{(@var{condition}
@var{body}@dots{})}}.
@@ -1557,6 +1557,12 @@ cond* Macro
evaluates to @code{nil}, the expressions for the values of subsequent
bindings are not evaluated.
+@findex bind-or*
+@code{(bind-or* @var{bindings}@dots{})} is like @code{bind-and*}, but
+the bindings are established only around the @emph{following}
+clauses. As a condition, it counts as true if any of the bindings
+evaluate to @code{nil}.
+
@findex match*
@findex pcase*
@code{(match* @var{pattern} @var{datum})} means to match @var{datum}
diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el
index ef0af260e89..dd787372b2e 100644
--- a/lisp/emacs-lisp/cond-star.el
+++ b/lisp/emacs-lisp/cond-star.el
@@ -71,6 +71,11 @@ cond*
`if-let*') for only the the body of the clause. If any expression
evaluates to nil, the condition counts as false.
+`(bind-or* BINDINGS...)' is the inverse of `bind-and*': if any
+expression in BINDINGS evaluates to nil, the condition counts as true;
+otherwise the bindings are established for only the remaining `cond*'
+clauses.
+
`(pcase* PATTERN DATUM)' means to match DATUM against the
pattern PATTERN, using the same pattern syntax as `pcase'.
The condition counts as true if PATTERN matches DATUM.
@@ -93,7 +98,8 @@ cond*
conditions."
(declare
(debug (&rest ([&or ("bind*" &rest &or symbolp (symbolp &optional form))
- ("bind-and*" &rest &or symbolp (symbolp form) (form))
+ ((&or "bind-and*" "bind-or*")
+ &rest &or symbolp (symbolp form) (form))
("match*" sexp form)
("pcase*" pcase-PAT form)
form]
@@ -186,6 +192,14 @@ bind-and*
(macroexp-warn-and-return "`bind-and*' used other than as a `cond*' condition"
nil 'suspicious))
+;;;###autoload
+(defmacro bind-or* (&rest _bindings)
+ "Evaluate BINDINGS like `if-let*'.
+This is not really a Lisp operator; it is meaningful only in the
+CONDITION of a `cond*' clause. See `cond*' for details."
+ (macroexp-warn-and-return "`bind-or*' used other than as a `cond*' condition"
+ nil 'suspicious))
+
;;;###autoload
(defmacro pcase* (_pattern _datum)
"Evaluate PATTERN and DATUM like an element of BINDINGS in `pcase-let'.
@@ -266,6 +280,64 @@ cond*-convert-clause
(cond*-convert-condition (car-safe clause) (cdr-safe clause) nil
rest (cond*-convert rest))))
+(defun cond*-convert-bind-conditional (condition then else uncondit-clauses)
+ "Convert a `bind-and*' or `bind-or*' cond* clause.
+CONDITION is the `bind-and*' or `bind-or*' form. THEN is an expression
+which is evaluated if the condition is true (all non-nil for
+`bind-and*', any nil for `bind-or*'); ELSE is evaluated if it is
+false. UNCONDIT-CLAUSES are like in `cond*-convert-condition'.
+
+The bindings are only in scope around the value forms in the bindings
+themselves, around UNCONDIT-CLAUSES, and in either the THEN
+expression (for `bind-and*') or the ELSE expression (for `bind-or*')."
+ (let ((is-and (eq (car condition) 'bind-and*))
+ (checks '())
+ (rebinds '())
+ (ignores '())
+ (last t)
+ (uncondit-clauses
+ (and uncondit-clauses (cond*-convert uncondit-clauses))))
+ ;; Since the bindings are not established around the alternative
+ ;; expression, bind them all initially to dummies, while binding the
+ ;; real variables to those dummies around each value form, and then
+ ;; finally bind all the rebinds around the consequent expression.
+ (dolist (bind (cdr condition))
+ (let ((dummy (gensym "value")))
+ (push (list dummy
+ (list 'and last
+ (if rebinds
+ `(let (,@rebinds)
+ (ignore ,@ignores) ;Satisfy the compiler
+ ,(cadr bind))
+ (cadr bind))))
+ checks)
+ (unless (eq (car bind) '_)
+ (push (list (car bind) dummy) rebinds)
+ (push (car bind) ignores))
+ (setq last dummy)))
+ (cond ((null rebinds) nil)
+ ((not is-and)
+ (and else (setq else `(let (,@rebinds)
+ (ignore ,@ignores)
+ ,else)))
+ (and uncondit-clauses (setq uncondit-clauses
+ `(let (,@rebinds)
+ (ignore ,@ignores)
+ ,uncondit-clauses))))
+ (then (setq then `(let (,@rebinds)
+ (ignore ,@ignores)
+ ,then)))
+ ;; `bind-and*' as the final clause with no consequent forms
+ ;; behaves like `and-let*'
+ (t (setq then last)))
+ (let ((test (if is-and last `(not ,last))))
+ (macroexp-let* (nreverse checks)
+ (if uncondit-clauses
+ `(progn
+ ,(macroexp-if test then else)
+ ,uncondit-clauses)
+ (macroexp-if test then else))))))
+
(defun cond*-convert-condition (condition true-exps uncondit-clauses rest iffalse)
"Process the condition part of one cond* clause.
TRUE-EXPS is a list of Lisp expressions to be executed if this
@@ -332,32 +404,9 @@ cond*-convert-condition
(let* ,mod-bindings
(when ,init-gensym
. ,true-exps)))))))
- ((eq pat-type 'bind-and*)
- (let ((checks '()) (last t))
- (dolist (bind (cdr condition))
- (push (list (car bind) (list 'and last (cadr bind)))
- checks)
- (when (eq (caar checks) '_)
- (setcar (car checks) (make-symbol "s")))
- (setq last (caar checks)))
- (cond
- ;; For explanations on these cases, see "Ordinary
- ;; Lisp expression is the condition." below.
- (rest
- (let ((quit (gensym "quit")))
- `(catch ',quit
- (let* (,@(nreverse checks))
- (if ,last (throw ',quit ,(macroexp-progn true-exps))))
- ,iffalse)))
- (uncondit-clauses
- `(progn
- (let* (,@(nreverse checks))
- (if ,last ,(macroexp-progn true-exps)))
- ,(cond*-convert uncondit-clauses)))
- (true-exps
- `(let* (,@(nreverse checks))
- (if ,last ,(macroexp-progn true-exps))))
- (t last))))
+ ((memq pat-type '(bind-and* bind-or*))
+ (cond*-convert-bind-conditional condition (macroexp-progn true-exps)
+ iffalse uncondit-clauses))
((eq pat-type 'pcase*)
(if true-exps
(progn
--
2.54.0
--=-=-=--
zach shaftel <zach@HIDDEN>:rms@HIDDEN, bug-gnu-emacs@HIDDEN.
Full text available.rms@HIDDEN, bug-gnu-emacs@HIDDEN:bug#81361; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.