From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Code for cond* Date: Thu, 25 Jan 2024 11:33:00 -0500 Message-ID: <35F5913F-A816-4B0B-9847-C43AA3C8E74F@gmail.com> References: <1AD5807F-91F7-4B92-BCB0-D0FEA904A75D@gmail.com> <67B51664-352E-4EB1-AE17-6D571999FDDE@gmail.com> <4B3E3A7E-677C-43A2-92B3-562E99A8B897@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25161"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Madhu , emacs-devel@gnu.org To: "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 25 17:34:07 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 1rT2g3-0006EV-RO for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Jan 2024 17:34:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT2fF-0005xh-4P; Thu, 25 Jan 2024 11:33:17 -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 1rT2fD-0005xD-Lz for emacs-devel@gnu.org; Thu, 25 Jan 2024 11:33:15 -0500 Original-Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rT2fC-00020R-2N; Thu, 25 Jan 2024 11:33:15 -0500 Original-Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7beefdfe71eso290046239f.0; Thu, 25 Jan 2024 08:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706200391; x=1706805191; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2oTpWF5OSdL2nE9LDOXuV56vmMDQ/JrEXZRLKREvC0k=; b=AX6zfeWgoMqUvh4KjPo7huRkCmntRQWXNmepFOMPn0OWki+1JGi4RcW/ZAKxSKvqsF mzARQ8O9o16A74LsksadaLF7BMd5EYf1Vg9kJe5OEKa/blamU66D3XohjoBOcAFr0pbg Jz+mUFRI/kAffGrhiAK8tczZ1yP2kUXhvDy04niEp+VVpVg6lxGMvhJQ2SrqcDrAVSyV FYIXKYs87LofBu4Z+HA7diyX76Bkhc5GsYlYktk6yehew2WFUUJkBCiSieFFz+D8JwaR mbp+ARP+IOcerPN2VLF52k5yafy2Br3FWO3ZnF+9VrROmqaHDEx3OsT5bMGLaDjqWDoT Hh5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706200391; x=1706805191; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2oTpWF5OSdL2nE9LDOXuV56vmMDQ/JrEXZRLKREvC0k=; b=QJLYDYsUGHbrod5JUaw9/Z7FRMLipqVjzPI1Z33c1mbkIDeWR9+lXa9jcd+bWkKz/1 OXdxMSF554/i9QpMmxtMopWhb/IbnC1bJ23+hdm3O6Ukh6S59YHLHpgbK9X5BnPlzptX zANgY4LSCDVRqwo/YlduC6mV+nfSJxI3qLADNVD8bDMAH0lWk94WiHKADSVyePu0HwIk lC1AuUQXF4X+sgs0fWp/XNcMbMhxjk8rNXvdKmW7GhkLM02WHb1txgK2aNg/lp/eOiOd NjaHtczAE3U9EZeIeVYH+fypGo+KfzuEAdo6KuvZi4fEjwLNOxkHLBSRtjcLXlgF/wjC NNtg== X-Gm-Message-State: AOJu0YyRzDUvmEMJHuZWz2pJHmzenK1w5bT5zP70ofmhiwtDnhB1XsL2 paBCD4wEIvxdBTn5raqsquXutlnJG8rYWy19f7lvXKEchdb/qoKtfLmRnRrP X-Google-Smtp-Source: AGHT+IHves2HCrYru9NH7UeWpj8wPQO4sWkrg9Lk+UkW2mux5DjaNe6jfqxfwVfCKG034qOm8lon4w== X-Received: by 2002:a92:db0f:0:b0:361:70d1:539e with SMTP id b15-20020a92db0f000000b0036170d1539emr1295962iln.21.1706200391585; Thu, 25 Jan 2024 08:33:11 -0800 (PST) Original-Received: from smtpclient.apple ([131.183.131.33]) by smtp.gmail.com with ESMTPSA id t4-20020a25aa84000000b00dbdbcb37e81sm3589279ybi.31.2024.01.25.08.33.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2024 08:33:10 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3774.300.61.1.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::d31; envelope-from=jdtsmith@gmail.com; helo=mail-io1-xd31.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, 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." 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:315381 Archived-At: > On Jan 25, 2024, at 11:12=E2=80=AFAM, Alfred M. Szmidt = wrote: >=20 > The above "idiom" is much easier to understand since it just uses well > known Lisp behaviour than modifying cond even if it is really ugly > ... the feature is a nice addition, but is it worth it? I tend to agree that wrapping the entire cond in let is not too bad. It = increases indentation depth for a very common need, but has the = advantage that you =E2=80=9Clook up to parent forms for the bindings=E2=80= =9D which I think is natural for most elisp developers. There is however no equivalent simple idiom for cond-let =E2=80=94 a = proposed member of the if-let/when-let family. Unless, that is, you = consider this simple: (catch 'cond-let (when simple0 (throw 'cond-let body0)) (when-let (bindings1) (throw 'cond-let body1)) (when-let (bindings2) (throw 'cond-let body2)) (when-let (bindings3) (throw 'cond-let body3)) (throw 'cond-let fallthrough-body))