aboutsummaryrefslogtreecommitdiff
path: root/python/step2_eval.py
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-03-29 17:35:53 -0500
committerJoel Martin <github@martintribe.org>2014-03-29 17:35:53 -0500
commitaef93ea3969feee92e68358395d5750ebe83f57d (patch)
tree9e38fae1432ac26f2c4915f3f38d8ae6ccfe54f8 /python/step2_eval.py
parent04517bc8265b6930e96735dd5d12b7aac7d86217 (diff)
downloadmal-aef93ea3969feee92e68358395d5750ebe83f57d.tar.gz
mal-aef93ea3969feee92e68358395d5750ebe83f57d.zip
PS: error handling, throw, print excpetions without dying.
Diffstat (limited to 'python/step2_eval.py')
-rw-r--r--python/step2_eval.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/step2_eval.py b/python/step2_eval.py
index bb5d6f8..65972a2 100644
--- a/python/step2_eval.py
+++ b/python/step2_eval.py
@@ -12,7 +12,10 @@ def READ(str):
# eval
def eval_ast(ast, env):
if symbol_Q(ast):
- return env[ast]
+ try:
+ return env[ast]
+ except:
+ raise Exception("'" + ast + "' not found")
elif list_Q(ast):
return new_list(*map(lambda a: EVAL(a, env), ast))
elif vector_Q(ast):