From dadd614fcb2dfe599d365fe1fb025e6989a6452f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 30 Aug 2008 13:31:13 -0500 Subject: [PATCH] fix teh docs --- extra/wordtimer/wordtimer-docs.factor | 13 +++++++------ extra/wordtimer/wordtimer.factor | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/extra/wordtimer/wordtimer-docs.factor b/extra/wordtimer/wordtimer-docs.factor index c13399e0f8..cfe6cfea49 100644 --- a/extra/wordtimer/wordtimer-docs.factor +++ b/extra/wordtimer/wordtimer-docs.factor @@ -1,4 +1,5 @@ -USING: help.syntax help.markup kernel prettyprint sequences ; +USING: help.syntax help.markup kernel prettyprint sequences +quotations words strings ; IN: wordtimer HELP: reset-word-timer @@ -6,18 +7,18 @@ HELP: reset-word-timer } ; HELP: add-timer -{ $values { "word" "a word" } } +{ $values { "word" word } } { $description "annotates the word with timing code which stores timing information globally. You can then view the info with print-word-timings" } ; HELP: add-timers -{ $values { "vocab" "a string" } } +{ $values { "vocab" string } } { $description "annotates all the words in the vocab with timer code. After profiling you can remove the annotations with reset-vocab" } ; HELP: reset-vocab -{ $values { "vocab" "a string" } } +{ $values { "vocab" string } } { $description "removes the annotations from all the words in the vocab" } ; @@ -29,13 +30,13 @@ HELP: correct-for-timing-overhead { $description "attempts to correct the timings to take into account the overhead of the timing function. This is pretty error-prone but can be handy when you're timing words that only take a handful of milliseconds but are called a lot" } ; HELP: profile-vocab -{ $values { "vocabspec" "string name of a vocab" } +{ $values { "vocab" string } { "quot" "a quotation to run" } } { $description "Annotates the words in the vocab with timing code then runs the quotation. Finally resets the words and prints the timings information." } ; HELP: wordtimer-call -{ $values { "quot" "a quotation to run" } } +{ $values { "quot" quotation } } { $description "Resets the wordtimer hash and runs the quotation. After the quotation has run it prints out the timed words" } ; diff --git a/extra/wordtimer/wordtimer.factor b/extra/wordtimer/wordtimer.factor index 15f50faa15..5dc65c661b 100644 --- a/extra/wordtimer/wordtimer.factor +++ b/extra/wordtimer/wordtimer.factor @@ -40,10 +40,10 @@ SYMBOL: *calling* : add-timer ( word -- ) dup [ (add-timer) ] annotate ; -: add-timers ( vocabspec -- ) +: add-timers ( vocab -- ) words [ add-timer ] each ; -: reset-vocab ( vocabspec -- ) +: reset-vocab ( vocab -- ) words [ reset ] each ; : dummy-word ( -- ) ; @@ -74,7 +74,7 @@ SYMBOL: *calling* "total time:" write r> pprint nl print-word-timings nl ; -: profile-vocab ( vocabspec quot -- ) +: profile-vocab ( vocab quot -- ) "annotating vocab..." print flush over [ reset-vocab ] [ add-timers ] bi reset-word-timer @@ -84,4 +84,4 @@ SYMBOL: *calling* reset-vocab correct-for-timing-overhead "total time:" write r> pprint - print-word-timings ; \ No newline at end of file + print-word-timings ;