emacs-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]