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:
parent
569d7f6a73
commit
a43ec2e7a3
1 changed files with 9 additions and 0 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Reference in a new issue