error checks for look up an undefined function

db4
James Cash 2008-05-14 20:46:22 -04:00
parent 2f4ef55ae5
commit c7500a0990
1 changed files with 2 additions and 1 deletions
extra/lisp

View File

@ -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