[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 12f63c18f6 1/2: Add new macro 'while-let'
From: |
Sean Whitton |
Subject: |
Re: master 12f63c18f6 1/2: Add new macro 'while-let' |
Date: |
Sun, 16 Oct 2022 15:59:53 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
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