Sha256: e693733d3ae59b5c5034a08b7c4f8c128a613b5d20f2f3e69df984e5ffbd9e4e

Contents?: true

Size: 1.33 KB

Versions: 12

Compression:

Stored size: 1.33 KB

Contents

(examples-for quasiquote
  ("same as quote for standalone item"             `a                                                     a)
  ("same as quote for standalone list"             `(a b c)                                               (a b c))
  ("substitutes single variables"                  (let b 10 `(a ,b c))                                   (a 10 c))
  ("substitutes a list"                            (let b '(1 2 3) `(a ,@b c))                            (a 1 2 3 c))
  ("substitutes a list at the end of a given list" (let b '(1 2 3) `(a ,b ,@b))                           (a (1 2 3) 1 2 3))
  ("unquotes an improper tail"                     (let c 42 `(a b . ,c))                                 (a b . 42))
  ("more complicated substitution example"         (with (d '(1 2 3) g '(x y z)) `(a (b c ,d (e f ,@g)))) (a (b c (1 2 3) (e f x y z))))
  ("peeks inside nested quotes"                    `(a b '(c ,(+ 1 2)))                                   (a b '(c 3)))
  ("handles nested unquote-splicing"               ``(a ,,@(list '+ 1 2) b)                               `((a ,(+ 1 2) b)))
  ("unquote-splices an improper tail"              (let c '(1 2 3) `(a b . ,@c))                          (a b 1 2 3))
  ("returns nested quasiquotes"                    `(a b `(c d ,(+ 1 2) ,,(+ 3 4)))                       (a b `(c d ,(+ 1 2) ,7))))

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
nydp-0.6.0 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.5.1 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.5.0 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.6 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.5 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.3 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.2 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.1 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.4.0 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.3.0 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.2.6 lib/lisp/tests/quasiquote-examples.nydp
nydp-0.2.5 lib/lisp/tests/quasiquote-examples.nydp