From ee1c45a403834ff51252f56f2ea16fd64b21a5f4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 17 Jul 2012 12:05:55 -0700 Subject: [PATCH] tools.walker: Give examples for breakpoint and breakpoint-if. Reported by tgunr --- basis/tools/walker/walker-docs.factor | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/basis/tools/walker/walker-docs.factor b/basis/tools/walker/walker-docs.factor index 454fb29372..6571afc64a 100644 --- a/basis/tools/walker/walker-docs.factor +++ b/basis/tools/walker/walker-docs.factor @@ -3,11 +3,23 @@ USING: help.syntax help.markup tools.continuations sequences math words ; HELP: breakpoint { $values { "word" word } } -{ $description "Annotates a word definition to enter the single stepper when executed." } ; +{ $description "Annotates a word definition to enter the single stepper when executed." } +{ $examples + { $unchecked-example "USE: tools.walker \\ sq breakpoint" + "" + } +} ; HELP: breakpoint-if { $values { "word" word } { "quot" { $quotation "( -- ? )" } } } -{ $description "Annotates a word definition to enter the single stepper if the quotation yields true." } ; +{ $description "Annotates a word definition to enter the single stepper if the quotation yields true. The quotation has access to the datastack as it exists just before " { $snippet "word" } " is called." } +{ $examples + "Break if the input to sq is 3:" + { $unchecked-example + "USE: tools.walker \\ sq [ dup 3 = ] breakpoint-if" + "" + } +} ; HELP: B { $description "An alias for " { $link break } ", defined in the " { $vocab-link "syntax" } " vocabulary so that it is always available." } ;