Add watch-vars
parent
765f9bfb43
commit
6bf808172b
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2005, 2007 Slava Pestov.
|
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel words parser io inspector quotations sequences
|
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
|
IN: tools.annotations
|
||||||
|
|
||||||
: reset ( word -- )
|
: reset ( word -- )
|
||||||
|
@ -49,6 +50,16 @@ IN: tools.annotations
|
||||||
: watch ( word -- )
|
: watch ( word -- )
|
||||||
dup [ (watch) ] annotate ;
|
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 -- )
|
: breakpoint ( word -- )
|
||||||
[ \ break add* ] annotate ;
|
[ \ break add* ] annotate ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue