[REBOL] Re: a new switch-like flow-control function
From: alain:goye:free at: 22-Dec-2003 11:41
Hello all from a newcomer to this list,
Here is a function for only 1 condition but 3 cases : if it can be
useful to anyone
trif: func [
condition
iftrue [block!]
iffalse [block!]
ifnone [block!]
] [
do either condition [
iftrue
] [
either none? condition [
ifnone
] [
iffalse
]
]
]
; example:
print trif request "give an answer" ["yes"]["no"]["cancel"]
by the way,
is it good that "not none" equals "true" ?
Alain Goyé.