projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
569d7f6
)
Add a pcase-let example to the manual
author
Lars Ingebrigtsen
<larsi@gnus.org>
Sat, 6 Nov 2021 19:40:28 +0000
(20:40 +0100)
committer
Lars Ingebrigtsen
<larsi@gnus.org>
Sat, 6 Nov 2021 20:59:27 +0000
(21:59 +0100)
* doc/lispref/control.texi (Destructuring with pcase Patterns):
Add a pcase-let example.
doc/lispref/control.texi
patch
|
blob
|
history
diff --git
a/doc/lispref/control.texi
b/doc/lispref/control.texi
index 30676f0fb116134269be3d262ad60633a2152d3f..06da1025186cfc5af0bfa424bc2abc8e716bcd74 100644
(file)
--- 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{}