From a43ec2e7a33ed7a5d4ff703171bc1c58d0ee0bea Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 6 Nov 2021 20:40:28 +0100 Subject: [PATCH] Add a pcase-let example to the manual * doc/lispref/control.texi (Destructuring with pcase Patterns): Add a pcase-let example. --- doc/lispref/control.texi | 9 +++++++++ 1 file changed, 9 insertions(+) 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{} -- 2.39.2