summaryrefslogtreecommitdiff
path: root/doc/ref/api-evaluation.texi
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-22 16:39:12 +0200
committerAndy Wingo <wingo@pobox.com>2016-07-25 11:49:40 +0200
commitad7e806a9fdc81062be966614f03f089eac469a4 (patch)
tree743bcdeddb284f8eec5c8ad3f09484f3cfe6169c /doc/ref/api-evaluation.texi
parent0cf155be72189c9b3e8af10fc03bac7db9f422df (diff)
downloadguile-ad7e806a9fdc81062be966614f03f089eac469a4.tar.gz
doc: Add unquote and unquote-splicing examples.
Suggested by Vincent Legoll <vincent.legoll@gmail.com>. * doc/ref/api-evaluation.texi (Expression Syntax): Add an unquote and an unquote-splicing example.
Diffstat (limited to 'doc/ref/api-evaluation.texi')
-rw-r--r--doc/ref/api-evaluation.texi4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 296f1da5a..3a3e9e632 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