2dup nil objeq? false =
while
2over 2over first-frame
- lookup-var-frame if
+ get-vars-vals-frame if
2drop 2drop
vars fetchobj vals fetchobj true
exit
objvar env
: define-var ( var val env -- )
- env objset
+ env setobj
- 2over env objfetch ( var val var env )
+ 2over env fetchobj ( var val var env )
get-vars-vals if
2swap 2drop ( var val vals )
set-car!
2drop
else
- env objfetch
+ env fetchobj
first-frame ( var val frame )
add-binding
then
cdr cdr car ;
: assignment? ( obj -- obj bool )
- set-symbol tagged-list? ;
+ set!-symbol tagged-list? ;
: assignment-var ( obj -- var )
cdr car ;
: assignment-val ( obj -- val )
cdr cdr car ;
+defer eval
+
: eval-definition ( obj env -- res )
2swap
2over 2over ( env obj env obj )
ok-symbol
;
-: eval ( obj env -- result )
+
+:noname ( obj env -- result )
2swap
self-evaluating? if
bold fg red ." Error evaluating expression - unrecognized type. Aborting." reset-term cr
abort
-;
+; is eval
\ }}}