nil? false =
while
2over 2over first-frame
- get-vars-vals-frame nil? false = if
+ get-vals-frame nil? false = if
2swap 2drop 2swap 2drop
exit
then
: lookup-var ( var env -- val )
2over var obj!
- get-vars-vals nil? if
+ get-vals nil? if
except-message: ." tried to read unbound variable '" var obj@ print ." '."
recoverable-exception throw
then
: set-var ( var val env -- )
2rot 2dup var obj! ( val env var )
- get-vars-vals nil? if
+ get-vals nil? if
except-message: ." tried to set unbound variable '" var obj@ print ." '."
recoverable-exception throw
else
get-vals-frame nil? if
2drop ( val frame var )
- 2swap add-binding
+ -2rot add-binding
else
( val frame var vals )
2swap 2drop 2swap 2drop
except-message: ." tried to print object with unknown type." recoverable-exception throw
; is print
+xxxx
\ }}}
\ ---- Garbage Collection ---- {{{