aboutsummaryrefslogtreecommitdiff
path: root/forth/step2_eval.fs
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-02-15 14:10:47 -0500
committerChouser <chouser@n01se.net>2015-02-21 13:22:44 -0500
commit136ce7c9afb5e103133fe6e423e6dad3d23db38d (patch)
treec317f90935a7ef0e65abd41122adfaa7576bb831 /forth/step2_eval.fs
parent60801ed68d5b2c6630c83883de150ccce98767f9 (diff)
downloadmal-136ce7c9afb5e103133fe6e423e6dad3d23db38d.tar.gz
mal-136ce7c9afb5e103133fe6e423e6dad3d23db38d.zip
forth: Split types for user fns vs native fns
Diffstat (limited to 'forth/step2_eval.fs')
-rw-r--r--forth/step2_eval.fs14
1 files changed, 7 insertions, 7 deletions
diff --git a/forth/step2_eval.fs b/forth/step2_eval.fs
index 6a9af72..4963111 100644
--- a/forth/step2_eval.fs
+++ b/forth/step2_eval.fs
@@ -7,10 +7,10 @@ require printer.fs
loop ;
MalMap/Empty
- s" +" MalSymbol. :noname args-as-native + MalInt. ; MalFn. rot assoc
- s" -" MalSymbol. :noname args-as-native - MalInt. ; MalFn. rot assoc
- s" *" MalSymbol. :noname args-as-native * MalInt. ; MalFn. rot assoc
- s" /" MalSymbol. :noname args-as-native / MalInt. ; MalFn. rot assoc
+ s" +" MalSymbol. :noname args-as-native + MalInt. ; MalNativeFn. rot assoc
+ s" -" MalSymbol. :noname args-as-native - MalInt. ; MalNativeFn. rot assoc
+ s" *" MalSymbol. :noname args-as-native * MalInt. ; MalNativeFn. rot assoc
+ s" /" MalSymbol. :noname args-as-native / MalInt. ; MalNativeFn. rot assoc
value repl-env
def-protocol-method mal-eval ( env ast -- val )
@@ -27,9 +27,9 @@ MalKeyword
get ;;
drop
-MalFn
+MalNativeFn
extend invoke ( ... mal-fn -- ... )
- MalFn/xt @ execute ;;
+ MalNativeFn/xt @ execute ;;
drop
MalSymbol
@@ -53,7 +53,7 @@ MalList
list MalList/count @ 0 ?do
env expr-start i cells + @ mal-eval ,
loop
- val-start cell+ here val-start - cell / 1- val-start @ ( argv argc MalFn )
+ val-start cell+ here val-start - cell / 1- val-start @ ( argv argc MalNativeFn )
invoke
val-start here - allot ;;
extend mal-eval-ast { env list -- list }