User Tools

Site Tools


ch2_1_backquote

This is an old revision of the document!


BACKQUOTE

Backquote expects one argument, typically a list, and can be also invoked with the backquote special character `. In the example for quote form, the backquote form works the same:

`(a b c)             ; backquote here is ..
(backquote (a b c))  ; .. same as quote

But in backquoted list, some parts can be switched back to evaluation with comma character (see unquote):

>`(a ,(+ 1 2) c)    ; backquoted list
(A 3 C)             ; form (+ 1 2) evaluated

While with normal quote we would have this:

>'(a ,(+ 1 2) c)         ; quoted list
(A (UNQUOTE (+ 1 2)) C)  ; comma character expanded, but not evaluated

And multiple backqoutes are ignored:

>``(a ,(+ 1 2) c)   ; multiple backquoting ..
(A 3 C)             ; .. behaves as single backquote
ch2_1_backquote.1618738223.txt.gz · Last modified: 2021/04/18 03:30 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki