跳轉到內容

Rebol 程式設計/either

來自華夏公益教科書
EITHER condition true-block false-block 

如果條件為真,則執行第一個塊,否則執行第二個塊。

EITHER 是一個原生值。

  • 條件 -- (型別: 任何)
  • 真塊 -- (型別: 塊)
  • 假塊 -- (型別: 塊)

原始碼

[編輯 | 編輯原始碼]
either: native[
    {If condition is TRUE, evaluates the first block, else evaluates the second.} 
    condition 
    true-block [block!] 
    false-block [block!]
]

華夏公益教科書