From 3a17cb968281f7e833088fdb22cf793861810912 Mon Sep 17 00:00:00 2001 From: Chouser Date: Sat, 21 Feb 2015 18:50:50 -0500 Subject: forth: Clean up symbol eval for better perf --- forth/step9_try.fs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'forth/step9_try.fs') diff --git a/forth/step9_try.fs b/forth/step9_try.fs index e11c691..4d4050b 100644 --- a/forth/step9_try.fs +++ b/forth/step9_try.fs @@ -263,10 +263,12 @@ defspecial try* { env list -- val } 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 + else + @ endif ;; drop -- cgit v1.2.3 From a631063f3fa2eaed473369b376a5499df92209bd Mon Sep 17 00:00:00 2001 From: Chouser Date: Sun, 22 Feb 2015 13:20:31 -0500 Subject: forth: Add map-hint to symbols for better perf --- forth/step9_try.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'forth/step9_try.fs') diff --git a/forth/step9_try.fs b/forth/step9_try.fs index 4d4050b..681e608 100644 --- a/forth/step9_try.fs +++ b/forth/step9_try.fs @@ -266,7 +266,7 @@ MalSymbol 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 ;; -- cgit v1.2.3