[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code for cond*
From: |
João Távora |
Subject: |
Re: Code for cond* |
Date: |
Fri, 19 Jan 2024 10:42:34 +0000 |
On Thu, Jan 18, 2024 at 3:44 PM Andrea Corallo <acorallo@gnu.org> wrote:
> apologies if it was discussed already, wanted to ask: what is the reason
> for some of these cond* clauses to keep the binding in effect outside
> the clause itself and for the whole cond* construct? At first glance it
> doesn't look very idiomatic in Lisp terms to me.
I think I asked the same, and Drew Adams and Adam Porter also
raised this point:
https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00554.html
https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00618.html
and I'm not sure we eventually clarified it. Apologies if I missed
some email addressing it as I'm not following this discussion in
detail.
Also, since cond* does a strict subset of what pcase does, has any
thought been given to implementing 'cond*' _on top_ of 'pcase', like
some systems define 'cond' in terms of 'if' (or vice versa)?
Not meant as gratuitous provocation, really. I think it'd have advantages:
* presumably every cond* feature can be supported (if indeed I'm right
about the "strict subset")
* it would probably save a lot of repeated code
* it would make it easy for those who can already read pcase
to just macroexpand the cond* form and see what it is actually
doing underneath.
So could actually facilitate the adoption path for 'cond*' (as
questionable as that path may still be, at least for some parties).
João
- Code for cond*, Richard Stallman, 2024/01/17
- Re: Code for cond*, Emanuel Berg, 2024/01/18
- Re: Code for cond*, Andrea Corallo, 2024/01/18
- Re: Code for cond*,
João Távora <=
- Re: Code for cond*, Richard Stallman, 2024/01/20
- Re: Code for cond*, Adam Porter, 2024/01/21
- Re: Code for cond*, tomas, 2024/01/22
- Re: Code for cond*, Richard Stallman, 2024/01/23
- Re: Code for cond*, Po Lu, 2024/01/24
- Re: Code for cond*, Stefan Kangas, 2024/01/24
- Re: Code for cond*, João Távora, 2024/01/24
- Re: Code for cond*, João Távora, 2024/01/24
- Re: Code for cond*, Po Lu, 2024/01/24
- Re: Code for cond*, Ihor Radchenko, 2024/01/24