2004-11-09 22:22:25 -05:00
|
|
|
IN: scratchpad
|
|
|
|
USE: interpreter
|
|
|
|
USE: test
|
|
|
|
USE: namespaces
|
|
|
|
USE: combinators
|
|
|
|
USE: stack
|
2004-11-21 19:27:18 -05:00
|
|
|
USE: stdio
|
|
|
|
USE: prettyprint
|
2004-11-09 22:22:25 -05:00
|
|
|
USE: math
|
|
|
|
USE: lists
|
|
|
|
USE: kernel
|
|
|
|
|
|
|
|
[ { 1 2 3 } ] [
|
|
|
|
init-interpreter [ 1 2 3 ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { "Yo" 2 } ] [
|
|
|
|
init-interpreter [ 2 >r "Yo" r> ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { 2 } ] [
|
|
|
|
init-interpreter [ t [ 2 ] [ "hi" ] ifte ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { "hi" } ] [
|
|
|
|
init-interpreter [ f [ 2 ] [ "hi" ] ifte ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { 4 } ] [
|
|
|
|
init-interpreter [ 2 2 fixnum+ ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { "Hey" "there" } ] [
|
|
|
|
init-interpreter [ [ "Hey" | "there" ] uncons ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { t } ] [
|
|
|
|
init-interpreter [ "XYZ" "XYZ" = ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { f } ] [
|
|
|
|
init-interpreter [ "XYZ" "XuZ" = ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { #{ 1 1.5 } { } #{ 1 1.5 } { } } ] [
|
|
|
|
init-interpreter [ #{ 1 1.5 } { } 2dup ] run meta-d get
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ { 4 } ] [
|
|
|
|
init-interpreter [ 2 2 + ] run meta-d get
|
|
|
|
] unit-test
|
2004-11-21 19:27:18 -05:00
|
|
|
|
|
|
|
[ { "4\n" } ] [
|
|
|
|
init-interpreter [ [ 2 2 + . ] with-string ] run meta-d get
|
|
|
|
] unit-test
|