aboutsummaryrefslogtreecommitdiff
path: root/forth/stepA_interop.fs
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-24 09:16:20 -0600
committerJoel Martin <github@martintribe.org>2015-02-24 09:16:20 -0600
commitff26ebdb816da07b28b29073868994fc7eabf8d1 (patch)
treeee0e08f5226525cb4885512e07ae53c30f185990 /forth/stepA_interop.fs
parent2a42d8274072c44dd2d83762cc27cd810f5b8452 (diff)
parenta631063f3fa2eaed473369b376a5499df92209bd (diff)
downloadmal-ff26ebdb816da07b28b29073868994fc7eabf8d1.tar.gz
mal-ff26ebdb816da07b28b29073868994fc7eabf8d1.zip
Merge pull request #8 from Chouser/forth3
Forth: Interop and perf updates
Diffstat (limited to 'forth/stepA_interop.fs')
-rw-r--r--forth/stepA_interop.fs13
1 files changed, 11 insertions, 2 deletions
diff --git a/forth/stepA_interop.fs b/forth/stepA_interop.fs
index 0a4050a..af5f5d8 100644
--- a/forth/stepA_interop.fs
+++ b/forth/stepA_interop.fs
@@ -261,12 +261,21 @@ defspecial try* { env list -- val }
catch-env catch0 cell+ @ TCO-eval
endif ;;
+defspecial . { env coll -- rtn-list }
+ depth { old-depth }
+ coll to-list dup MalList/count @ swap MalList/start @ { count start }
+ count cells start + start cell+ +do
+ env i @ eval as-native
+ cell +loop ;;
+
MalSymbol
extend mal-eval { env sym -- val }
- 0 sym env get
+ sym env env/get-addr
dup 0= if
drop
- 0 0 s" ' not found" sym as-native s" '" ...throw-str
+ 0 0 s" ' not found" sym pr-str s" '" ...throw-str
+ else
+ @
endif ;;
drop