Checkpoint attempting to fix `list`.
Chris Pressey
4 years ago
7 | 7 |
|
8 | 8 |
-> Functionality "Evaluate Robin Expression (with literal and list)" is implemented by shell command
|
9 | 9 |
-> "bin/robin --no-builtins stdlib/literal.robin stdlib/list.robin eval %(test-body-file)"
|
|
10 |
|
|
11 |
-> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command
|
|
12 |
-> "bin/robin --no-builtins stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)"
|
10 | 13 |
|
11 | 14 |
-> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command
|
12 | 15 |
-> "bin/robin --no-builtins pkg/small.robin eval %(test-body-file)"
|
7 | 7 |
|
8 | 8 |
-> Functionality "Evaluate Robin Expression (with literal and list)" is implemented by shell command
|
9 | 9 |
-> "bin/robin stdlib/literal.robin stdlib/list.robin eval %(test-body-file)"
|
|
10 |
|
|
11 |
-> Functionality "Evaluate Robin Expression (with literal and bind and list)" is implemented by shell command
|
|
12 |
-> "bin/robin stdlib/literal.robin stdlib/bind.robin stdlib/list.robin eval %(test-body-file)"
|
10 | 13 |
|
11 | 14 |
-> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command
|
12 | 15 |
-> "bin/robin eval %(test-body-file)"
|
9 | 9 |
stdlib/subtract.robin stdlib/symbol-p.robin stdlib/tail.robin \
|
10 | 10 |
> pkg/intrinsics.robin
|
11 | 11 |
|
12 | |
cat stdlib/literal.robin stdlib/env.robin stdlib/list.robin stdlib/bind.robin \
|
13 | |
stdlib/let.robin stdlib/choose.robin \
|
|
12 |
cat stdlib/literal.robin stdlib/env.robin stdlib/bind.robin \
|
|
13 |
stdlib/list.robin stdlib/let.robin stdlib/choose.robin \
|
14 | 14 |
stdlib/bind-args.robin \
|
15 | 15 |
stdlib/fun.robin > pkg/small.robin
|
16 | 16 |
|
0 | 0 |
;'<<SPEC'
|
1 | 1 |
|
2 | |
-> Tests for functionality "Evaluate Robin Expression (with Small)"
|
|
2 |
-> Tests for functionality "Evaluate Robin Expression (with literal and bind and list)"
|
3 | 3 |
|
4 | 4 |
`list` is a macro which evaluates each of its arguments, and evaluates to a
|
5 | 5 |
(proper) list containing each of the results, in the same order.
|
|
23 | 23 |
'<<SPEC'
|
24 | 24 |
|
25 | 25 |
(define list (macro (args env)
|
26 | |
(if (equal? args ())
|
27 | |
()
|
28 | |
(prepend (eval env (head args))
|
29 | |
(eval env (prepend self (tail args)))))))
|
|
26 |
(bind list-r (macro (args env)
|
|
27 |
(bind self (eval (head args) env)
|
|
28 |
(bind items (eval (head (tail args)) env)
|
|
29 |
(if (equal? items ())
|
|
30 |
()
|
|
31 |
(prepend (eval env (head items))
|
|
32 |
(self self (tail items)))))))
|
|
33 |
(list-r list-r args))))
|
30 | 34 |
|
26 | 26 |
|
27 | 27 |
'<<SPEC'
|
28 | 28 |
|
29 | |
(define literal (macro (self args env) (head args)))
|
|
29 |
(define literal (macro (args env) (head args)))
|