forked from rebol/rebol
-
Notifications
You must be signed in to change notification settings - Fork 2
Switch
angerangel edited this page Mar 19, 2013
·
1 revision
SWITCH value cases /default case /all
Selects a choice and evaluates the block that follows it.
SWITCH is a native value.
- value -- Target value
- cases -- Block of cases to check (block!)
-
/default
- case -- Default case if no others found
- /all -- Evaluate all matches (not just first one)
#SOURCE
switch: make native! [ [
{Selects a choice and evaluates the block that follows it.}
value "Target value"
cases [block!] "Block of cases to check"
/default case "Default case if no others found"
/all "Evaluate all matches (not just first one)"
] ]