X-Loop: help-debbugs@HIDDEN
Subject: bug#79660: 30.2.50; let-alist lambdas
Resent-From: Augusto Stoffel <arstoffel@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: emacs@HIDDEN, me@HIDDEN, bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Oct 2025 07:14:02 +0000
Resent-Message-ID: <handler.79660.B.176094439326920 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 79660
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 79660 <at> debbugs.gnu.org
Cc: Artur Malabarba <emacs@HIDDEN>, Eshel Yaron <me@HIDDEN>
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
X-Debbugs-Original-Xcc: Artur Malabarba <emacs@HIDDEN>, Eshel Yaron <me@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.176094439326920
(code B ref -1); Mon, 20 Oct 2025 07:14:02 +0000
Received: (at submit) by debbugs.gnu.org; 20 Oct 2025 07:13:13 +0000
Received: from localhost ([127.0.0.1]:43333 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1vAk4v-000707-BN
for submit <at> debbugs.gnu.org; Mon, 20 Oct 2025 03:13:13 -0400
Received: from lists.gnu.org ([2001:470:142::17]:52480)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <arstoffel@HIDDEN>)
id 1vAk4t-0006zX-17
for submit <at> debbugs.gnu.org; Mon, 20 Oct 2025 03:13:11 -0400
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 <arstoffel@HIDDEN>)
id 1vAk4k-0004bx-7f
for bug-gnu-emacs@HIDDEN; Mon, 20 Oct 2025 03:13:02 -0400
Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from <arstoffel@HIDDEN>)
id 1vAk4h-0006V3-DK
for bug-gnu-emacs@HIDDEN; Mon, 20 Oct 2025 03:13:01 -0400
Received: by mail-ej1-x631.google.com with SMTP id
a640c23a62f3a-b3e234fcd4bso690984766b.3
for <bug-gnu-emacs@HIDDEN>; Mon, 20 Oct 2025 00:12:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1760944377; x=1761549177; darn=gnu.org;
h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
:date:message-id:reply-to;
bh=H23PlIuG5Cq36IzdpGWuuICaV9Fv9BddC0bZBBrhYRU=;
b=TbI9/jnZY7tltqu386e58bZftRM136pJr9u/Jzv8gaoXjuM0KOZsDv72PQVpi8e4/p
A0zqpBOFQq0npulzyjHn5S2L4VTv7S1BSmiR3/EqYOIrYgZIk9Jz1CK6BpgHJQCozl/O
1o78wbegDSUofeo4o5HVL0ZYLQbNXrIH0Jy2YwC0KPNAqpcM8wDJk+yKLXrp8jGgQdCF
zNSHmjrN7JU4qmFpeP2XuUms0QjOycZfComjEHVLgNxHRU+eS1L9rfTb2NgM37BPgWLi
KV73r95BU+U9ZFP847UA/M0smotgHXh1vkoVNhAABtkZ0o5iSWl8BC/k1yTnFThHG2CS
olpg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1760944377; x=1761549177;
h=mime-version:message-id:date:subject:to:from:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=H23PlIuG5Cq36IzdpGWuuICaV9Fv9BddC0bZBBrhYRU=;
b=Qtjqq9NNOssUlpHLeqeeH51ct85K50lbKaxcfso3Is8PZj+V3eTHwOUgjggHAamXGQ
QPa/upwLdAtEd0786QdUg5QjxAkoE9tb/GMVXC7nyNlynS8kIhMFUgVZeQ0amY8XAOpP
3XyAf1v0IYhU+I4MICgDq19R32T4tTPbdwJAuVCA4MAZjtyxp/AO/OCPfkjz435VDXie
vCrRHvFap3zTv1O1L5vOZH8EIqFJWu3a+4nQhUMfK5wypNXsOXkRoRMX8w47F9wYxRN7
e83vseILbCRNzB5eRGN1wGkbfGN55YOwKbesRPLEzojOJXtRqJmJcKt4npLOXKTTytkP
mAbw==
X-Gm-Message-State: AOJu0YyEO8Do8NVYHoVTh8YuvwRRBOagdZsNsImEkWRgjeB0Oy9LIk6i
BsipoRt1phjhdq9/7oc7jFJNzvZmtd1VFMi5y8bY2qAgND+Nwent0uYoe9gGIg==
X-Gm-Gg: ASbGncvCiGw/Hsffhg+LIEU59HAfNFM7aNUjOdLsuoY2UaColAxfDP/LVeJvGhPYxhs
JheozN3mWHCQh6qRZx4JghlFx5BqHy6EqlzCXs2niO0+0eu3TzrDoKoMXEZJwHRw4EwltQwD35O
hPWPlE/j/NRqSH4t7VR4ipwpHNv5Wm2rfoWY5WB8UWqsDYlQN1kyVoX89ImSV4a0hJQnmqY+KMe
p6ipoFIww8KEFEwDmMF4XTS7WHYBreSveyQE/ZSCZ5RMXXyp2tQNVhuYs4VZ9ycLTaaYzaj/bOA
G+wEj7D+R4AO84X5NL4pRjhg75WnME5HwaVZq1cJS1DE7BDrbdPC445e2OiF825fNePaMxC8lhE
Vfe1ob1MwTTWqaYm3bc3bOyRY/wexsX8vYAwayqDLlK7JqOyzDKQosds6zHYv8AvcgCvgT4jHSd
7M
X-Google-Smtp-Source: AGHT+IFbyXy4c+zeq+pfiPdb6K0EuriiMUoaxyzzOW6DUQFHiXy3qOzOlk0GmyEUF3Mrvc0vHQdbGA==
X-Received: by 2002:a17:907:9488:b0:b41:12bf:e3aa with SMTP id
a640c23a62f3a-b6472131b21mr1510374766b.16.1760944369969;
Mon, 20 Oct 2025 00:12:49 -0700 (PDT)
Received: from ars3 ([89.246.250.22]) by smtp.gmail.com with ESMTPSA id
a640c23a62f3a-b65e7da3412sm710997966b.3.2025.10.20.00.12.49
for <bug-gnu-emacs@HIDDEN>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 20 Oct 2025 00:12:49 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
Date: Mon, 20 Oct 2025 09:12:49 +0200
Message-ID: <87cy6i2gi6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::631;
envelope-from=arstoffel@HIDDEN; helo=mail-ej1-x631.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 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
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.0 (/)
When working with lots of alists, I often find myself writing
(lambda (alist) (let-alist alist BODY))
which, while simple, is pretty cacophonous. So I'd like to suggest
adding a little new macro, let-alist-lambda or lambda-alist such that
(lambda-alist BODY)
expands to the above. Perhaps entirely superfluously, here are some
examples of how this would be used and looks pretty nice:
Find someone by name in a list of people:
(seq-some (lambda-alist (equal .name "John"))
people)
Sort a list of people by age:
(sort people :key (lambda-alist .age))
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Augusto Stoffel <arstoffel@HIDDEN> Subject: bug#79660: Acknowledgement (30.2.50; let-alist lambdas) Message-ID: <handler.79660.B.176094439326920.ack <at> debbugs.gnu.org> References: <87cy6i2gi6.fsf@HIDDEN> X-Gnu-PR-Message: ack 79660 X-Gnu-PR-Package: emacs Reply-To: 79660 <at> debbugs.gnu.org Date: Mon, 20 Oct 2025 07:14:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. As you requested using X-Debbugs-CC, your message was also forwarded to Artur Malabarba <emacs@HIDDEN>, Eshel Yaron <me@eshelyaro= n.com> (after having been given a bug report number, if it did not have one). Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 79660 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 79660: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79660 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#79660: 30.2.50; let-alist lambdas
Resent-From: Eshel Yaron <me@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Oct 2025 11:31:01 +0000
Resent-Message-ID: <handler.79660.B79660.17609598061216 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79660
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Augusto Stoffel <arstoffel@HIDDEN>
Cc: Artur Malabarba <emacs@HIDDEN>, 79660 <at> debbugs.gnu.org
Received: via spool by 79660-submit <at> debbugs.gnu.org id=B79660.17609598061216
(code B ref 79660); Mon, 20 Oct 2025 11:31:01 +0000
Received: (at 79660) by debbugs.gnu.org; 20 Oct 2025 11:30:06 +0000
Received: from localhost ([127.0.0.1]:44301 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1vAo5U-0000Ia-Vb
for submit <at> debbugs.gnu.org; Mon, 20 Oct 2025 07:30:05 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:56796 helo=eshelyaron.com)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1vAo5S-0000Fh-7O
for 79660 <at> debbugs.gnu.org; Mon, 20 Oct 2025 07:30:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
s=mail; t=1760959800;
bh=KkJX/G0dguIrEKb0F+fP3T9zRqLNX69cwi9hta24pvQ=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=MJWwHy7aoB6AiRVmr8GZOoignHQoCC/N+AROzBBm8CHKPo/4CFsxElHRXFpvpM57y
cnkrMyVCnwyMeqVph0CdvoozvV0w1puBB0eSdw99N4lNLJY5un5giUHv9QaLe29WgE
0psiBF1RBXJRsFaA9b/o5hPug/MMpU1Vuh7UAo3ohC2dvrkMgTL9HwMqtmoZGxc+le
SWdKY2AwQM1ZqWlyzO3iBOnDfnp1UNi3l5UvJ5T9ffXRm4KQgbaiz7d+i5RMkmYWna
jOhVhS+Kx4D/xEOA9BEClFTK5jhH0+l/2N9Ww1vk6DlQGiCYaPB407EtfiP0tcvh7n
ZQEBFG5Ap7rGg==
From: Eshel Yaron <me@HIDDEN>
In-Reply-To: <87cy6i2gi6.fsf@HIDDEN>
References: <87cy6i2gi6.fsf@HIDDEN>
Date: Mon, 20 Oct 2025 13:29:55 +0200
Message-ID: <87jz0pbyks.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
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 (-)
Hi Augusto,
Augusto Stoffel <arstoffel@HIDDEN> writes:
> When working with lots of alists, I often find myself writing
>
> (lambda (alist) (let-alist alist BODY))
>
> which, while simple, is pretty cacophonous. So I'd like to suggest
> adding a little new macro, let-alist-lambda or lambda-alist such that
>
> (lambda-alist BODY)
>
> expands to the above.
Should this be (lambda-alist ALIST BODY...)? Or is the intention to
"hardcode" the variable name 'alist' for the alist?
I assume I'm CC'd as the last person to touch let-alist, but actually
I've only investigated it to be able to analyze let-alist forms
correctly in what became elisp-scope.el, so I don't really have any
strong opinions about the proposed addition. Since I'm already here,
I'll give my hot take: let-alist is currently not robust enough to
implement new constructs on top of it. (Namely, the code analysis in
let-alist--deep-dot-search suffers from both false negatives and false
positives; I can elaborate if anybody's interested, I just don't want to
derail the discussion from adding a new macro to problems in let-alist.)
That said, lambda-alist seems simple enough that it doesn't introduce
any additional issues, and I see that the pattern it simplifies indeed
already occurs in core Emacs code, so why not? :)
Eshel
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.