@var{pattern} of each clause, in textual order. If the value matches,
the clause succeeds; @code{pcase} then evaluates its @var{body-forms},
and returns the value of the last of @var{body-forms}. Any remaining
-@var{clauses} are ignored.
+@var{clauses} are ignored. If no clauses match, then the @code{pcase}
+form evaluates to @code{nil}.
The @var{pattern} part of a clause can be of one of two types:
@dfn{QPattern}, a pattern quoted with a backquote; or a
A significant difference from `cl-destructuring-bind' is that, if
a pattern match fails, the next case is tried until either a
-successful match is found or there are no more cases.
+successful match is found or there are no more cases. The CODE
+expression corresponding to the matching pattern determines the
+return value. If there is no match the returned value is nil.
Another difference is that pattern elements may be quoted,
meaning they must match exactly: The pattern \\='(foo bar)
;;;###autoload
(defmacro pcase-exhaustive (exp &rest cases)
- "The exhaustive version of `pcase' (which see)."
+ "The exhaustive version of `pcase' (which see).
+If EXP fails to match any of the patterns in CASES, an error is signaled."
(declare (indent 1) (debug pcase))
(let* ((x (gensym "x"))
(pcase--dontwarn-upats (cons x pcase--dontwarn-upats)))