combinators: minor improvement in usage example of case word
parent
8d2ceda8f3
commit
db14fff1ae
|
@ -351,14 +351,16 @@ HELP: case
|
||||||
{ $code "dup X = [ drop Y ] [ dup Z = [ drop T ] [ no-case ] if ] if" }
|
{ $code "dup X = [ drop Y ] [ dup Z = [ drop T ] [ no-case ] if ] if" }
|
||||||
}
|
}
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $code
|
{ $example
|
||||||
"SYMBOL: yes SYMBOL: no SYMBOL: maybe"
|
"USING: combinators io kernel ;"
|
||||||
|
"SYMBOLS: yes no maybe ;"
|
||||||
"maybe {"
|
"maybe {"
|
||||||
" { yes [ ] } ! Do nothing"
|
" { yes [ ] } ! Do nothing"
|
||||||
" { no [ \"No way!\" throw ] }"
|
" { no [ \"No way!\" throw ] }"
|
||||||
" { maybe [ \"Make up your mind!\" print ] }"
|
" { maybe [ \"Make up your mind!\" print ] }"
|
||||||
" [ \"Invalid input; try again.\" print ]"
|
" [ \"Invalid input; try again.\" print ]"
|
||||||
"} case"
|
"} case"
|
||||||
|
"Make up your mind!"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue