From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- .../elisp/pattern_002dmatching-conditional.html | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 devdocs/elisp/pattern_002dmatching-conditional.html (limited to 'devdocs/elisp/pattern_002dmatching-conditional.html') diff --git a/devdocs/elisp/pattern_002dmatching-conditional.html b/devdocs/elisp/pattern_002dmatching-conditional.html new file mode 100644 index 00000000..7221cf8b --- /dev/null +++ b/devdocs/elisp/pattern_002dmatching-conditional.html @@ -0,0 +1,31 @@ +

Pattern-Matching Conditional

Aside from the four basic conditional forms, Emacs Lisp also has a pattern-matching conditional form, the pcase macro, a hybrid of cond and cl-case (see Conditionals in Common Lisp Extensions) that overcomes their limitations and introduces the pattern matching programming style. The limitations that pcase overcomes are:

Conceptually, the pcase macro borrows the first-arg focus of cl-case and the clause-processing flow of cond, replacing condition with a generalization of the equality test which is a variant of pattern matching, and adding facilities so that you can concisely express a clause’s predicate, and arrange to share let-bindings between a clause’s predicate and body-forms.

The concise expression of a predicate is known as a pattern. When the predicate, called on the value of the first arg, returns non-nil, we say that “the pattern matches the value” (or sometimes “the value matches the pattern”).

+ + + + + + + + + + + + + + + +
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Pattern_002dMatching-Conditional.html +

+
-- cgit v1.2.3