git @ Cat's Eye Technologies Robin / 694abba
Checkpoint attempting to fix `list`. Chris Pressey 4 years ago
5 changed file(s) with 18 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
77
88 -> Functionality "Evaluate Robin Expression (with literal and list)" is implemented by shell command
99 -> "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)"
1013
1114 -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command
1215 -> "bin/robin --no-builtins pkg/small.robin eval %(test-body-file)"
77
88 -> Functionality "Evaluate Robin Expression (with literal and list)" is implemented by shell command
99 -> "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)"
1013
1114 -> Functionality "Evaluate Robin Expression (with Small)" is implemented by shell command
1215 -> "bin/robin eval %(test-body-file)"
99 stdlib/subtract.robin stdlib/symbol-p.robin stdlib/tail.robin \
1010 > pkg/intrinsics.robin
1111
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 \
1414 stdlib/bind-args.robin \
1515 stdlib/fun.robin > pkg/small.robin
1616
00 ;'<<SPEC'
11
2 -> Tests for functionality "Evaluate Robin Expression (with Small)"
2 -> Tests for functionality "Evaluate Robin Expression (with literal and bind and list)"
33
44 `list` is a macro which evaluates each of its arguments, and evaluates to a
55 (proper) list containing each of the results, in the same order.
2323 '<<SPEC'
2424
2525 (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))))
3034
2626
2727 '<<SPEC'
2828
29 (define literal (macro (self args env) (head args)))
29 (define literal (macro (args env) (head args)))