Add a pcase-let example to the manual

* doc/lispref/control.texi (Destructuring with pcase Patterns):
Add a pcase-let example.
This commit is contained in:
Lars Ingebrigtsen 2021-11-06 20:40:28 +01:00
parent 569d7f6a73
commit a43ec2e7a3

View file

@ -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{}