File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 88{ $subsections
99 watch
1010 watch-vars
11+ POSTPONE: <WATCH
1112}
1213"Timing words:"
1314{ $subsections
@@ -34,6 +35,10 @@ HELP: watch
3435
3536{ watch watch-vars reset } related-words
3637
38+ HELP: <WATCH
39+ { $syntax "<WATCH ... WATCH>" }
40+ { $description "Allows wrapping a block of code and record stack values entering and exiting the block of code." } ;
41+
3742HELP: reset
3843{ $values
3944 { "word" word } }
Original file line number Diff line number Diff line change 11! Copyright (C) 2005, 2010 Slava Pestov.
22! See https://factorcode.org/license.txt for BSD license.
3- USING: accessors arrays assocs combinators.short-circuit compiler.units effects
4- generalizations generic inspector io kernel math namespaces prettyprint
5- quotations sequences sequences.deep sequences.generalizations sorting summary
3+ USING: accessors arrays assocs combinators.short-circuit
4+ compiler.units effects generalizations generic inspector io
5+ kernel math namespaces parser prettyprint quotations sequences
6+ sequences.deep sequences.generalizations sorting summary
67tools.time vocabs words ;
78IN: tools.annotations
89
@@ -122,6 +123,11 @@ PRIVATE>
122123: watch-vars ( word vars -- )
123124 dupd '[ [ _ _ ] dip (watch-vars) ] annotate ;
124125
126+ DEFER: <WATCH
127+
128+ SYNTAX: <WATCH
129+ \ WATCH> parse-until >quotation dup (watch) append! ;
130+
125131SYMBOL: word-timing
126132
127133word-timing [ H{ } clone ] initialize
You can’t perform that action at this time.
0 commit comments