diff --git a/extra/tools/annotations/annotations.factor b/extra/tools/annotations/annotations.factor index 6dee51cbc0..eed23e8bc1 100755 --- a/extra/tools/annotations/annotations.factor +++ b/extra/tools/annotations/annotations.factor @@ -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 ;