A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.gnu.org/software/emacs/manual/html_node/elisp/Pattern_002dMatching-Conditional.html below:

Pattern-Matching Conditional (GNU Emacs Lisp Reference Manual)

Next: Iteration, Previous: Constructs for Combining Conditions, Up: Control Structures   [Contents][Index]

11.4 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”).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4