From c7500a09908b4463f5c29c17afc7a17a118ff2b2 Mon Sep 17 00:00:00 2001 From: James Cash Date: Wed, 14 May 2008 20:46:22 -0400 Subject: [PATCH] error checks for look up an undefined function --- extra/lisp/lisp.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/lisp/lisp.factor b/extra/lisp/lisp.factor index 8582021d6d..3e4cdca41f 100644 --- a/extra/lisp/lisp.factor +++ b/extra/lisp/lisp.factor @@ -76,6 +76,7 @@ PRIVATE> ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SYMBOL: lisp-env +ERROR: no-such-var var ; : init-env ( -- ) H{ } clone lisp-env set ; @@ -84,7 +85,7 @@ SYMBOL: lisp-env swap lisp-env get set-at ; : lisp-get ( name -- word ) - lisp-env get at ; + dup lisp-env get at [ ] [ no-such-var ] ?if ; : funcall ( quot sym -- * ) dup lisp-symbol? [ name>> lisp-get ] when call ; inline \ No newline at end of file