unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: 44166@debbugs.gnu.org
Cc: monnier@iro.umontreal.ca
Subject: bug#44166: pcase-exhaustive doc string could be more didactic
Date: Thu, 22 Oct 2020 20:30:41 -0700	[thread overview]
Message-ID: <CADwFkmkFDFvK06CD9M0JPfXGBGM1=CWJtpVQd1-VRKxEQ-NZRw@mail.gmail.com> (raw)

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?





             reply	other threads:[~2020-10-23  3:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  3:30 Stefan Kangas [this message]
2021-09-19 15:34 ` bug#44166: pcase-exhaustive doc string could be more didactic Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmkFDFvK06CD9M0JPfXGBGM1=CWJtpVQd1-VRKxEQ-NZRw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=44166@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).