 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 SYMBOL: lisp-env
-ERROR: no-such-var var ;
+ERROR: no-such-var variable-name ;
     
 SYMBOL: macro-env
     

! See http://factorcode.org/license.txt for BSD license.
USING: kernel peg sequences arrays strings combinators.lib
namespaces combinators math locals locals.private accessors
vectors syntax lisp.parser assocs parser sequences.lib words quotations
fry lists inspector ;
IN: lisp

DEFER: convert-form

    dup lisp-symbol?  [ lookup-var ] when call ; inline
    
: define-primitive ( name vocab word -- )  
    swap lookup 1quotation '[ , compose call ] swap lisp-define ;
    
: lookup-macro ( lisp-symbol -- lambda )
    name>> macro-env get at ;
    
: define-lisp-macro ( quot name -- )
    macro-env get set-at ;
    
: lisp-macro? ( car -- ? )
    dup lisp-symbol? [ name>> macro-env get key? ] [ drop f ] if ;
