- (c-quasiquote X) → resultsyntax
Implements quasiquotation. Added in version 0.3.0.
The core ck macro has special support for converting (quasiquote x) (also written as `x) into (c-quasiquote 'x). Within a call to c-quasiquote, you can use (unquote y) (also written as ,y) and (unquote-splicing z) (also written as ,@z). They are supported inside vectors as well as inside pairs/lists.
;; These expressions are exactly equivalent: (ck () `(define (foo) (list ,@(c-list '1 '2) ,(c-vector '3)))) (ck () (c-quasiquote '(define (foo) (list ,@(c-list '1 '2) ,(c-vector '3))))) ;; ==> (define (foo) (list 1 2 #(3))) (ck () `#(1 ,@(c-list '2 '3))) (ck () (c-quasiquote '#(1 ,@(c-list '2 '3)))) ;; ==> #(1 2 3)