GNU bug report logs - #44166
pcase-exhaustive doc string could be more didactic

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Fri, 23 Oct 2020 03:31:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44166 in the body.
You can then email your comments to 44166 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#44166; Package emacs. (Fri, 23 Oct 2020 03:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Fri, 23 Oct 2020 03:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: pcase-exhaustive doc string could be more didactic
Date: Thu, 22 Oct 2020 20:30:41 -0700
The doc string of `pcase-exhaustive' could be more didactic.  It says:

    pcase-exhaustive is a Lisp macro in ‘pcase.el’.

    (pcase-exhaustive EXP &rest CASES)

    The exhaustive version of ‘pcase’ (which see).
    If EXP fails to match any of the patterns in CASES, an error is signaled.

From reading the code, I understand that this is the same as pcase, but
signals an error if there is no match?  If this is correct, may I
suggest to amend the doc string as follows?

    The exhaustive version of ‘pcase’ (which see).
    If EXP fails to match any of the patterns in CASES, an error is
    signaled.
    In contrast, `pcase' will only return nil if there is no match.

Also, should it be added to the ELisp manual?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44166; Package emacs. (Sun, 19 Sep 2021 15:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 44166 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: 44166 <at> debbugs.gnu.org
Cc: monnier <at> iro.umontreal.ca
Subject: Re: bug#44166: pcase-exhaustive doc string could be more didactic
Date: Sun, 19 Sep 2021 08:34:16 -0700
tags 44166 + fixed
close 44166 28.1
thanks

Stefan Kangas <stefan <at> marxist.se> writes:

> The doc string of `pcase-exhaustive' could be more didactic.  It says:
>
>     pcase-exhaustive is a Lisp macro in ‘pcase.el’.
>
>     (pcase-exhaustive EXP &rest CASES)
>
>     The exhaustive version of ‘pcase’ (which see).
>     If EXP fails to match any of the patterns in CASES, an error is signaled.
>
>>From reading the code, I understand that this is the same as pcase, but
> signals an error if there is no match?  If this is correct, may I
> suggest to amend the doc string as follows?
>
>     The exhaustive version of ‘pcase’ (which see).
>     If EXP fails to match any of the patterns in CASES, an error is
>     signaled.
>     In contrast, `pcase' will only return nil if there is no match.

There have been no comments here within a year, so I've now pushed a
change like this to master (commit 86837a87b7).

> Also, should it be added to the ELisp manual?

I guess not.  Closing this bug.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 19 Sep 2021 15:35:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 44166 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 19 Sep 2021 15:35:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Oct 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.