combinators: minor improvement to usage example of cond word

db4
Keita Haga 2011-02-04 17:53:00 +09:00
parent 65773e520d
commit c997e43ca8
1 changed files with 8 additions and 6 deletions

View File

@ -326,12 +326,14 @@ HELP: cond
}
{ $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
{ $examples
{ $code
"{"
" { [ dup 0 > ] [ \"positive\" ] }"
" { [ dup 0 < ] [ \"negative\" ] }"
" [ \"zero\" ]"
"} cond"
{ $example
"USING: combinators io kernel math ;"
"0 {"
" { [ dup 0 > ] [ drop \"positive\" ] }"
" { [ dup 0 < ] [ drop \"negative\" ] }"
" [ drop \"zero\" ]"
"} cond print"
"zero"
}
} ;