combinators: minor improvement to usage example of cond word
parent
65773e520d
commit
c997e43ca8
|
@ -326,12 +326,14 @@ HELP: cond
|
||||||
}
|
}
|
||||||
{ $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
|
{ $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $code
|
{ $example
|
||||||
"{"
|
"USING: combinators io kernel math ;"
|
||||||
" { [ dup 0 > ] [ \"positive\" ] }"
|
"0 {"
|
||||||
" { [ dup 0 < ] [ \"negative\" ] }"
|
" { [ dup 0 > ] [ drop \"positive\" ] }"
|
||||||
" [ \"zero\" ]"
|
" { [ dup 0 < ] [ drop \"negative\" ] }"
|
||||||
"} cond"
|
" [ drop \"zero\" ]"
|
||||||
|
"} cond print"
|
||||||
|
"zero"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue