Rebol 程式設計/switch
外觀
SWITCH value cases /default case /all
選擇一個選項並評估其後的塊。
SWITCH 是一個原生值。
- 值 -- 要搜尋的值。 (型別:任何)
- 情況 -- 要搜尋的案例塊。 (型別:塊)
- /預設
- 情況 -- 如果沒有找到其他情況,則為預設情況。 (型別:任何)
- /all -- 評估所有匹配項(不僅僅是第一個)。
switch: native[
{Selects a choice and evaluates the block that follows it.}
value "Value to search for."
cases [block!] "Block of cases to search."
/default case "Default case if no others are found."
/all "Evaluates all matches (not just first one)."
]