GNU bug report logs -
#79998
31.0.50; cond*: cdr-safe seems not work but cdr-ignore can.
Previous Next
To reply to this bug, email your comments to 79998 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79998; Package
emacs.
(Sat, 13 Dec 2025 11:53:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Yue Yi" <include_yy <at> qq.com>:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org.
(Sat, 13 Dec 2025 11:53:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello, Emacs maintainers,
In the docstring of match*, it says:
(cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. That means
that ‘list' patterns do not examine the final cdr.
Based on my understanding, cdr-safe should match improper lists or
similar structures. For example:
(cond* ((match* (cdr-safe (list x y)) '(1 2 . 3)))) => nil
However, running this triggers a warning: Warning: Complex pattern
nested in constrained variable pattern
I found that using cdr-ignore, which appears in the implementation
source code, works as expected:
(cond* ((match* (cdr-ignore (list x y)) '(1 2 . 3)))) ;;=> t
I would like to ask: Is this a documentation error? Should the docstring
and other references (like the Info manual) be updated to replace
cdr-safe with cdr-ignore?
Regards.
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79998; Package
emacs.
(Mon, 15 Dec 2025 12:03:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 79998 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Sat 13 Dec 2025 at 07:51pm +08, Yue Yi wrote:
> In the docstring of match*, it says:
>
> (cdr-safe PATTERN) matches PATTERN with lax checking of cdrs. That means
> that ‘list' patterns do not examine the final cdr.
>
> Based on my understanding, cdr-safe should match improper lists or
> similar structures. For example:
>
> (cond* ((match* (cdr-safe (list x y)) '(1 2 . 3)))) => nil
>
> However, running this triggers a warning: Warning: Complex pattern
> nested in constrained variable pattern
>
> I found that using cdr-ignore, which appears in the implementation
> source code, works as expected:
>
> (cond* ((match* (cdr-ignore (list x y)) '(1 2 . 3)))) ;;=> t
>
> I would like to ask: Is this a documentation error? Should the docstring
> and other references (like the Info manual) be updated to replace
> cdr-safe with cdr-ignore?
Yes, it looks like Richard decided to rename cdr-safe to cdr-ignore but
missed updating the docstring. I've looked in the mailing list archives
and didn't see anything to suggest otherwise.
Richard, would you mind confirming? "cdr-safe" was a work-in-progress
name, and "cdr-ignore" was the name for this match* operator that you
went for in the end?
--
Sean Whitton
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.