From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: JD Smith <jdtsmith@gmail.com>
Newsgroups: gmane.emacs.devel
Subject: Re: Code for cond* - cond*-match, cond*-subpat and backtrack-aliases
Date: Thu, 1 Feb 2024 09:54:28 -0500
Message-ID: <BBEB6B0B-C87E-432F-BFFD-8038630CE09F@gmail.com>
References: <E1rQJDv-0001UG-2E@fencepost.gnu.org> <ZbEFGl4lj81inF-f@ACM>
 <ZbJpy33YiqYPahyW@ACM> <E1rUIAz-0007X4-1l@fencepost.gnu.org>
 <87FCC950-68F3-4BE1-9ADC-FE1AB6C2BEC9@gmail.com>
 <E1rVO7H-0007x7-11@fencepost.gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_7D2B1740-ED43-49F3-86EF-AEA3BD0AB4F5"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="2140"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Alan Mackenzie <acm@muc.de>,
 emacs-devel <emacs-devel@gnu.org>
To: rms@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 01 15:55:41 2024
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1rVYTd-0000Ne-0u
	for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Feb 2024 15:55:41 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces@gnu.org>)
	id 1rVYSq-0000T7-JF; Thu, 01 Feb 2024 09:54:52 -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 <jdtsmith@gmail.com>)
 id 1rVYSi-0000R9-NU
 for emacs-devel@gnu.org; Thu, 01 Feb 2024 09:54:45 -0500
Original-Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jdtsmith@gmail.com>)
 id 1rVYSg-0000ZA-Li; Thu, 01 Feb 2024 09:54:43 -0500
Original-Received: by mail-yw1-x112e.google.com with SMTP id
 00721157ae682-60406f4e1d0so10202307b3.1; 
 Thu, 01 Feb 2024 06:54:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706799280; x=1707404080; darn=gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=yg3SelDlD7UQKgMg+rXvSWHtVwwEC5TTq8cLFZCkTtQ=;
 b=NH/56DV8BX1/a6DX+X4+0NTKmjJuB8vYGJiufjQ1GglvuJHIoFKuGLB4FLxPCAZf83
 gNNVsQEw0eMEk1KxSchneUhVaPFfks9V+BufcA+75uagEDf2grN9qT4h3IhJwr+TiySc
 4b2tW6CdZJV945oettUgOT27hNW0lnFQU87Tnt7gBzFOhjI17YNGYPWsAwt8IE3kuZNV
 seZ5uR7oT38hoT64AqWjU4nq3NDyP92IwogT9vhkp8VGA9XDPWyaOi+DNh9H9um0hn2W
 50sSS6AduK45Hlb478pIF3FLq0dovF/ct3Dk7NHHua5Z2WXBXSaQXbn0ASNVkf4C6Tqv
 FlKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706799280; x=1707404080;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=yg3SelDlD7UQKgMg+rXvSWHtVwwEC5TTq8cLFZCkTtQ=;
 b=raF+TkKubdMqdNIsqc7q6tz7I5MiUNOa70LjnfHnNBATGxgU3m9LCwanWDJHFoj+dP
 NQmE5s5xUV62hTaP/X/0Z0+pAxZ4+68G1/Ov5KwLanxIkV9y6wZJk0aJRywoYq/Qwemu
 P6KSzhi2DTUdFo78Az0DH+TBKEzW5CeMEnFeO3moRv8/1sJMRCpIsQ9PWguLg5PXhJFP
 uSQK7qW+irk709PzXW5XRVPUFb96yh2+ygxOdIOh4VMmzMjlkIaq5b9LSytm0QinFkPT
 ZrqA+X6t+c+nKKKPtkCeNMZfz16JA2JW3Nm8HntQJ1lwzQM7TwVjeq9/0MU936ydfCM9
 qqeA==
X-Gm-Message-State: AOJu0YzI+HfKT2ClZVlpcpFecu0PI53UuHHei6frMvJnGu57oT3NHOmS
 tcrNvHJB/8TAVeocbmM5EFMrWcABcdVyzQaFqBfATNnjv+FkVAYuxCcWttzm
X-Google-Smtp-Source: AGHT+IFMKnfGoT3dL8S4ZaI0w6C2zsda2oYV9erljEeNbo1fyNPjOAGAmqwaTTU9lDsxKGQ6fmjWqw==
X-Received: by 2002:a0d:ea4d:0:b0:604:666:4232 with SMTP id
 t74-20020a0dea4d000000b0060406664232mr2252153ywe.16.1706799279708; 
 Thu, 01 Feb 2024 06:54:39 -0800 (PST)
X-Forwarded-Encrypted: i=0;
 AJvYcCU7ZnN4Cra0oe/FAfMQ7Koz2awy4it6HK3I9Vf8J+PLTVi5ck7sfyvQAqosA5OSZmyCMq6q/W1/sHLAG2RdKdrLTWPy
Original-Received: from smtpclient.apple ([131.183.131.33])
 by smtp.gmail.com with ESMTPSA id
 bd3-20020a05690c010300b005ff952f0073sm4349157ywb.11.2024.02.01.06.54.38
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 01 Feb 2024 06:54:39 -0800 (PST)
In-Reply-To: <E1rVO7H-0007x7-11@fencepost.gnu.org>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
Received-SPF: pass client-ip=2607:f8b0:4864:20::112e;
 envelope-from=jdtsmith@gmail.com; helo=mail-yw1-x112e.google.com
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, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=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:315700
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/315700>


--Apple-Mail=_7D2B1740-ED43-49F3-86EF-AEA3BD0AB4F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Jan 31, 2024, at 10:51=E2=80=AFPM, Richard Stallman <rms@gnu.org> =
wrote:
>=20
> [[[ 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. ]]]
>=20
>> I wonder why (bind*) evaluates only its first value to determine
>> if the binding condition is true?  We already have macros which
>> evaluate the "truth of a set of bindings": the members of the
>> if-let family.  And they
>=20
>> "Evaluate each binding in turn, as in =E2=80=98let*=E2=80=99, =
stopping if a
>> binding value is nil.  If all are non-nil return the [final]
>> value."
>=20
> That does not seem natural to me at all.  I don't see that it is
> better.

It's very natural and familiar to users of if/when/and-let (close to =
1000 calls in core packages), since this description is copied verbatim =
from their docs.  It is a natural way to avoid pre-calculating things =
you don't want to calculate until a prior step holds true. =20

A typical logical paths might be:

Is some variable non-nil?
Is it a plist?
Does that plist has a :foobar element?
Is that :foobar element's value a vector.
Is slot 4 of that vector non-nil?  Call it `result'.=20
If all of the above are true, (do-something-with result)=

--Apple-Mail=_7D2B1740-ED43-49F3-86EF-AEA3BD0AB4F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Jan 31, 2024, at 10:51=E2=80=AFPM, Richard =
Stallman &lt;rms@gnu.org&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><div>[[[ To any NSA and FBI =
agents reading my email: please consider &nbsp;&nbsp;&nbsp;]]]<br>[[[ =
whether defending the US Constitution against all enemies, =
&nbsp;&nbsp;&nbsp;&nbsp;]]]<br>[[[ foreign or domestic, requires you to =
follow Snowden's example. ]]]<br><br><blockquote type=3D"cite">I wonder =
why (bind*) evaluates only its first value to determine<br>if the =
binding condition is true? &nbsp;We already have macros =
which<br>evaluate the "truth of a set of bindings": the members of =
the<br>if-let family. &nbsp;And they<br></blockquote><br><blockquote =
type=3D"cite">"Evaluate each binding in turn, as in =E2=80=98let*=E2=80=99=
, stopping if a<br>binding value is nil. &nbsp;If all are non-nil return =
the [final]<br>value."<br></blockquote><br>That does not seem natural to =
me at all. &nbsp;I don't see that it =
is<br>better.<br></div></div></blockquote></div><br><div>It's very =
natural and familiar to users of if/when/and-let (close to 1000 calls in =
core packages), since this description is copied verbatim from their =
docs. &nbsp;It is a natural way to avoid pre-calculating things you =
don't want to calculate until a prior step holds true. =
&nbsp;</div><div><br></div><div>A typical logical paths might =
be:</div><div><br></div><div><ol class=3D"MailOutline"><li>Is some =
variable non-nil?</li><li>Is it a plist?</li><li>Does that plist has a =
:foobar element?</li><li>Is that :foobar element's value a =
vector.</li><li>Is slot 4 of that vector non-nil? &nbsp;Call it =
`result'.&nbsp;</li><li>If all of the above are true, (do-something-with =
result)</li></ol></div></body></html>=

--Apple-Mail=_7D2B1740-ED43-49F3-86EF-AEA3BD0AB4F5--