From: Sean Whitton <spwhitton@spwhitton.name>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: master 12f63c18f6 1/2: Add new macro 'while-let'
Date: Sun, 16 Oct 2022 15:59:53 -0700 [thread overview]
Message-ID: <8735bn9xxy.fsf@melete.silentflame.com> (raw)
In-Reply-To: <87h7045db0.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 16 Oct 2022 09:26:59 +0000")
Hello,
On Sun 16 Oct 2022 at 09:26AM GMT, Philip Kaludercic wrote:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> On that topic, why do we have `and-let*' and no `and-let'?
>>
>> I'd rather ask "why do we have and-let at all"? 😀
>>
>> If you look at the in-tree usages of and-let*, most of them should
>> clearly have been when-let instead, so I think it was a mistake to add
>> and-let.
>
> I have recently started appreciating `and-let*' when I want to make it
> explicit that the last binding is the return value, but I guess that any
>
> (and-let* ((foo bar) ... (baz qux)))
>
> is the same as
>
> (when-let ((foo bar) ...) (baz qux))
Yeah, that's a Lisp convention I learned from Magit's maintainer --
when/unless for side-effects, and/or for return value. I appreciate
having and-let for this reason.
--
Sean Whitton
next prev parent reply other threads:[~2022-10-16 22:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <166436449368.11560.17915607619196292155@vcs2.savannah.gnu.org>
[not found] ` <20220928112814.B0924C12D9B@vcs2.savannah.gnu.org>
2022-09-28 15:25 ` master 12f63c18f6 1/2: Add new macro 'while-let' Philip Kaludercic
2022-09-29 10:29 ` Lars Ingebrigtsen
2022-09-29 11:42 ` Philip Kaludercic
2022-09-29 11:48 ` Lars Ingebrigtsen
2022-10-15 14:12 ` Philip Kaludercic
2022-10-16 7:45 ` Lars Ingebrigtsen
2022-10-16 9:26 ` Philip Kaludercic
2022-10-16 22:59 ` Sean Whitton [this message]
2022-10-17 0:14 ` [External] : " Drew Adams
2022-09-28 12:04 Visuwesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735bn9xxy.fsf@melete.silentflame.com \
--to=spwhitton@spwhitton.name \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.