Add watch-vars

db4
Slava Pestov 2008-02-10 01:38:51 -06:00
parent 765f9bfb43
commit 6bf808172b
1 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,8 @@
! Copyright (C) 2005, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel words parser io inspector quotations sequences
prettyprint continuations effects definitions compiler.units ;
prettyprint continuations effects definitions compiler.units
namespaces assocs ;
IN: tools.annotations
: reset ( word -- )
@ -49,6 +50,16 @@ IN: tools.annotations
: watch ( word -- )
dup [ (watch) ] annotate ;
: (watch-vars) ( quot word vars -- newquot )
[
"--- Entering: " write swap .
"--- Variable values:" print
[ dup get ] H{ } map>assoc describe
] 2curry swap compose ;
: watch-vars ( word vars -- )
dupd [ (watch-vars) ] 2curry annotate ;
: breakpoint ( word -- )
[ \ break add* ] annotate ;