From: Lars Ingebrigtsen Date: Sat, 6 Nov 2021 19:40:28 +0000 (+0100) Subject: Add a pcase-let example to the manual X-Git-Tag: emacs-29.0.90~3671^2~172 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a43ec2e7a33ed7a5d4ff703171bc1c58d0ee0bea;p=emacs.git Add a pcase-let example to the manual * doc/lispref/control.texi (Destructuring with pcase Patterns): Add a pcase-let example. --- diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 30676f0fb11..06da1025186 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -1283,6 +1283,15 @@ bindings that can then be used inside @var{body}. The variable bindings are produced by destructuring binding of elements of @var{pattern} to the values of the corresponding elements of the evaluated @var{exp}. + +Here's a trivial example: + +@example +(pcase-let ((`(,major ,minor) + (split-string "image/png" "/"))) + minor) + @result{} "png" +@end example @end defmac @defmac pcase-let* bindings body@dots{}