[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/01: doc: Add unquote and unquote-splicing examples.
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 01/01: doc: Add unquote and unquote-splicing examples. |
Date: |
Fri, 22 Jul 2016 14:40:16 +0000 (UTC) |
civodul pushed a commit to branch stable-2.0
in repository guile.
commit 141e390b596bfb6464f4d692381232e974de8783
Author: Ludovic Courtès <address@hidden>
Date: Fri Jul 22 16:39:12 2016 +0200
doc: Add unquote and unquote-splicing examples.
Suggested by Vincent Legoll <address@hidden>.
* doc/ref/api-evaluation.texi (Expression Syntax): Add an unquote and an
unquote-splicing example.
---
doc/ref/api-evaluation.texi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 88f713d..059a859 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -136,6 +136,7 @@ an expression to be evaluated and inserted. The comma
syntax @code{,}
is simply a shorthand for an @code{unquote} form. For example,
@example
+`(1 2 (* 9 9) 3 4) @result{} (1 2 (* 9 9) 3 4)
`(1 2 ,(* 9 9) 3 4) @result{} (1 2 81 3 4)
`(1 (unquote (+ 1 1)) 3) @result{} (1 2 3)
`#(1 ,(/ 12 2)) @result{} #(1 6)
@@ -153,8 +154,9 @@ the returned list inserted. @var{expr} must evaluate to a
list. The
@example
(define x '(2 3))
+`(1 ,x 4) @result{} (1 (2 3) 4)
`(1 ,@@x 4) @result{} (1 2 3 4)
-`(1 (unquote-splicing (map 1+ x))) @result{} (1 3 4)
+`(1 (unquote-splicing (map 1+ x))) @result{} (1 3 4)
`#(9 ,@@x 9) @result{} #(9 2 3 9)
@end example