[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?
From: |
Stefan Monnier |
Subject: |
bug#73853: 31.0.50; Should and-let* become a synonym for when-let*? |
Date: |
Sun, 27 Oct 2024 10:41:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> Thinking the first example further we could introduce parallel versions
> and name them `if-let', `when-let' and `and-let'. They would be really
> analogue to `let' with respect to binding list semantics - compared to
> the non-parallel counterparts `if-let*' that are what we have now.
>
> ATM this idea looks appealing to me as a final goal.
The only natural semantics for something like when-let is the
"sequential" bindings of `let*`. The `let` and `letrec` semantics are
"unnatural" here, so we should have only the `let*` semantics.
The implementation of a `when-let` that has a binding semantics like
that of `let` rather than `let*` would have to macroexpand
(when-let ((a (fooa))
(b (foob))
...)
(bar))
to something like:
(when-let* ((t1 (fooa))
(t2 (foob))
...)
(let ((a t1)
(b t2)
...)
(bar)))
So coders who "simplify" `when-let*` to `when-let` when the * version is
not needed, would in reality just pessimize their code.
I'll let you guess where I stand w.r.t to naming of `when-let` vs
`when-let*`, based on the fact that I originally implemented `dlet` with
the semantics of `let*`. 🙂
Stefan
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, (continued)
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Stefan Kangas, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Heerdegen, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Albinus, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Heerdegen, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Sean Whitton, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Albinus, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Heerdegen, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Sean Whitton, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Albinus, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Heerdegen, 2024/10/28
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?,
Stefan Monnier <=
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Michael Heerdegen, 2024/10/28
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Stefan Monnier, 2024/10/28
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Drew Adams, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Howard Melman, 2024/10/27
- bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Sean Whitton, 2024/10/27
bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?, Jonas Bernoulli, 2024/10/29