forked from Geomol/World
-
Notifications
You must be signed in to change notification settings - Fork 0
Either
btiffin edited this page Dec 27, 2011
·
4 revisions
either condition true-block false-block
If condition is true, evaluates the first block, else evaluates the second.
either is a function!
condition -- [any-type!]
true-block -- [block!]
false-block -- [block!]
w> num: 5
== 5
w> either zero? num and 1 ["Even"] ["Odd"]
== "Odd"
w> print either zero? num and 1 ["Even"] ["Odd"]
Odd
w> num: 50
== 50
w> print [num "is" either zero? num and 1 ["Even"] ["Odd"]]
50 is Even