tools.interpreter cleanup

release
Slava Pestov 2007-10-03 18:33:19 -04:00
parent 3914576d25
commit 1ef514ebdb
2 changed files with 2 additions and 12 deletions

View File

@ -18,8 +18,6 @@ ARTICLE: "meta-interp-travel" "Backwards time travel"
{ $subsection history }
"If this variable holds a vector, the interpreter state is automatically saved after every step. It can be saved at other points manually:"
{ $subsection save-interpreter }
"You can also restore any prior state:"
{ $subsection restore-interpreter }
"Or restore the most recently saved state:"
{ $subsection step-back } ;
@ -48,10 +46,6 @@ HELP: history
HELP: save-interpreter
{ $description "Snapshots the single stepper state and saves it in " { $link history } "." } ;
HELP: restore-interpreter
{ $values { "ns" continuation } }
{ $description "Restores the single stepper to a former state, which must have been saved by a call to " { $link save-interpreter } "." } ;
HELP: step
{ $description "Evaluates the object in the single stepper using Factor evaluation semantics:"
{ $list

View File

@ -26,8 +26,7 @@ M: continuation restore
clone interpreter set ;
M: pair restore
first2 clone interpreter set
[ nip f ] curry with-interpreter-datastack ;
first2 restore [ nip f ] curry with-interpreter-datastack ;
M: f restore
drop interpreter off ;
@ -73,12 +72,9 @@ SYMBOL: history
: save-interpreter ( -- )
history get [ interpreter get clone swap push ] when* ;
: restore-interpreter ( interp -- )
clone interpreter set ;
: step-back ( -- )
history get dup empty?
[ drop ] [ pop restore-interpreter ] if ;
[ drop ] [ pop restore ] if ;
: (continue) ( continuation -- )
>continuation<