[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code for cond*
|
From: |
JD Smith |
|
Subject: |
Re: Code for cond* |
|
Date: |
Thu, 25 Jan 2024 11:33:00 -0500 |
> On Jan 25, 2024, at 11:12 AM, Alfred M. Szmidt <ams@gnu.org> wrote:
>
> 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 “look up to parent forms for the bindings” which I think is natural for
most elisp developers.
There is however no equivalent simple idiom for cond-let — 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))
- RE: [External] : Re: Code for cond*, (continued)
- RE: [External] : Re: Code for cond*, Drew Adams, 2024/01/24
- Re: Code for cond*, Madhu, 2024/01/25
- Re: Code for cond*, Stefan Monnier, 2024/01/25
- Re: Code for cond*, JD Smith, 2024/01/25
- Re: Code for cond*, JD Smith, 2024/01/25
- Re: Code for cond*, Alfred M. Szmidt, 2024/01/25
- Re: Code for cond*, JD Smith, 2024/01/25
- Re: Code for cond*, Stefan Monnier, 2024/01/25
- Re: Code for cond*, Alfred M. Szmidt, 2024/01/25
- Re: Code for cond*, Stefan Monnier, 2024/01/25
- Re: Code for cond*,
JD Smith <=
- Re: Code for cond*, Richard Stallman, 2024/01/28
Re: Code for cond*, Richard Stallman, 2024/01/25
Re: Code for cond*, Richard Stallman, 2024/01/25
Re: Code for cond*, Alan Mackenzie, 2024/01/24