blob: 276d5395ae04ab9ff2e10f716821aa31cce9813d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
(load "../common")
(test
(mapcar (ap (op (ret `@@@1-@@@rest`))) '((a b) (c d) (e f)))
("a-b" "c-d" "e-f"))
(test
(let ((a "abc") (b 123))
`@{b 12} @{b -12} @{a [0] 3} @{a [0..2] -5}`)
"123 123 a ab")
(test
(let ((a "abc") (b 123))
[(ret `@1-@2-@@1-@@2-@{@1 -4}-@{@2 -4}`) a b])
"abc-123-abc-123- abc- 123")
(test
[(ret `@1-@rest`) 1 2 3 4]
"1-2 3 4")
(test
[(ret `@1-@@rest`) 1 2 3 4]
"1-2 3 4")
(test
[(ret [(ret `@1 @rest @@1 @@rest @@@rest @@@1`) 1 10]) 2 20]
"1 10 1 10 20 2")
(test
(let ((s))
(mapcar (ret `@(push (inc @1) s)`) (range 0 2)))
("1" "2 1" "3 2 1"))
(test
(symacrolet ((d "-"))
(let ((s))
(mapcar (ret `<@{(push (inc @1) s) d}>`) (range 0 2))))
("<1>" "<2-1>" "<3-2-1>"))
|