From aef93ea3969feee92e68358395d5750ebe83f57d Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 29 Mar 2014 17:35:53 -0500 Subject: PS: error handling, throw, print excpetions without dying. --- python/step2_eval.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/step2_eval.py') 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): -- cgit v1.2.3