emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a43ec2e 1/3: Add a pcase-let example to the manual


From: Lars Ingebrigtsen
Subject: master a43ec2e 1/3: Add a pcase-let example to the manual
Date: Sat, 6 Nov 2021 16:59:36 -0400 (EDT)

branch: master
commit a43ec2e7a33ed7a5d4ff703171bc1c58d0ee0bea
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 30676f0..06da102 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{}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]