[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code for cond*
From: |
Stefan Monnier |
Subject: |
Re: Code for cond* |
Date: |
Mon, 12 Feb 2024 19:48:55 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> > Admittedly, for `cdr-ignore` it would take more than a one-liner,
> > because it affects the interpretation of all the patterns within it
> > (which makes its meaning somewhat unclear: should `(constrain x (null
> > (cdr x)))` be ignored if it appears within a `cdr-ignore`?).
> It affects only the built-in patterns that destructure cons cells
> and lists
That still doesn't clarify its meaning.
E.g. I understand that `(head ,b) should match (head 1 2), but what
about matching a value like (head) ?
The code I have found so far makes it not match (head).
How should this be documented?
Why was this chosen?
The main use-case I can think of for `cdr-ignore` is when matching
against things like Lisp code, where a pattern like
`(lambda ,args . ,body)
should also match (lambda) because (lambda) is a (broken) lambda
expression rather than being something *else* than a lambda expression.
So I'm not sure the behavior you chose for `cdr-ignore` is the one
we want.
Stefan
- Re: Code for cond*, Richard Stallman, 2024/02/02
- Re: Code for cond*, Stefan Monnier, 2024/02/03
- Re: Code for cond*, Emanuel Berg, 2024/02/03
- Re: Code for cond*, Richard Stallman, 2024/02/03
- Re: Code for cond*, Richard Stallman, 2024/02/03
- Re: Code for cond*, Stefan Monnier, 2024/02/04
- Re: Code for cond*,
Stefan Monnier <=
- Re: Code for cond*, Stefan Monnier, 2024/02/12
- Re: Code for cond*, Richard Stallman, 2024/02/14
- Re: Code for cond*, Stefan Monnier, 2024/02/14
- Re: Code for cond*, Richard Stallman, 2024/02/21
- Re: Code for cond*, Stefan Monnier, 2024/02/21
- Re: Code for cond*, Richard Stallman, 2024/02/24
- Re: Code for cond*, Stefan Monnier, 2024/02/25
- Re: Code for cond*, Richard Stallman, 2024/02/28
- Re: Code for cond*, Stefan Monnier, 2024/02/29
- Re: Code for cond*, Richard Stallman, 2024/02/28