unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44166: pcase-exhaustive doc string could be more didactic
@ 2020-10-23  3:30 Stefan Kangas
  2021-09-19 15:34 ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kangas @ 2020-10-23  3:30 UTC (permalink / raw)
  To: 44166; +Cc: monnier

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?





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#44166: pcase-exhaustive doc string could be more didactic
  2020-10-23  3:30 bug#44166: pcase-exhaustive doc string could be more didactic Stefan Kangas
@ 2021-09-19 15:34 ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2021-09-19 15:34 UTC (permalink / raw)
  To: 44166; +Cc: monnier

tags 44166 + fixed
close 44166 28.1
thanks

Stefan Kangas <stefan@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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-19 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23  3:30 bug#44166: pcase-exhaustive doc string could be more didactic Stefan Kangas
2021-09-19 15:34 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).