diff options
| author | Joel Martin <github@martintribe.org> | 2014-03-29 17:35:53 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-03-29 17:35:53 -0500 |
| commit | aef93ea3969feee92e68358395d5750ebe83f57d (patch) | |
| tree | 9e38fae1432ac26f2c4915f3f38d8ae6ccfe54f8 /python/step2_eval.py | |
| parent | 04517bc8265b6930e96735dd5d12b7aac7d86217 (diff) | |
| download | mal-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.py | 5 |
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): |
