]> gitweb.factorcode.org Git - factor.git/blob - extra/combinators/extras/extras-docs.factor
factor: clean up whitespace in -docs files
[factor.git] / extra / combinators / extras / extras-docs.factor
1 USING: combinators help.markup help.syntax ;
2
3 IN: combinators.extras
4
5 HELP: cond-case
6 { $values { "assoc" "a sequence of quotation pairs and an optional quotation" } }
7 { $description
8     "Similar to " { $link case } ", this evaluates an " { $snippet "obj" } " according to the first quotation in each pair.  If any quotation returns true, calls the second quotation without " { $snippet "obj" } " on the stack."
9     $nl
10     "If there is no quotation that returns true, the default case is taken.  If the last element of " { $snippet "assoc" } " is a quotation, the quotation is called with " { $snippet "obj" } " on the stack.  Otherwise, a " { $link no-cond } " error is raised."
11 }
12 { $examples
13     { $example
14         "USING: combinators.extras io kernel math ;"
15         "0 {"
16         "    { [ 0 > ] [ \"positive\" ] }"
17         "    { [ 0 < ] [ \"negative\" ] }"
18         "    [ drop \"zero\" ]"
19         "} cond-case print"
20         "zero"
21     }
22 } ;