if 語句有多個分支
d = Dates.dayofweek(now())
if d == 7
println("It is Sunday!")
elseif d == 6
println("It is Saturday!")
elseif d == 5
println("Almost the weekend!")
else
println("Not the weekend yet...")
end
任何數量的 elseif 分支都可以與 if 語句一起使用,可能有或沒有最終的 else 分支。只有在發現所有先前條件為 false 時,才會評估後續條件。