Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1,4 +1,4 @@
|
|||
int i = 19
|
||||
int i ← 19
|
||||
^|if–then–else|^
|
||||
if i > 18
|
||||
writeLine("greater than 18")
|
||||
|
|
@ -6,14 +6,14 @@ else
|
|||
writeLine("less or equal to 18")
|
||||
end
|
||||
^|else if|^
|
||||
if i == 18 do writeLine("equal to 18")
|
||||
if i æ 18 do writeLine("equal to 18")
|
||||
else if i < 18 do writeLine("less than 18")
|
||||
else do writeLine("greater than 18")
|
||||
end
|
||||
^|when expression: just like iif in Visual Basic|^
|
||||
writeLine(when(i > 18, "greater than 18", "less or equal to 18"))
|
||||
^|hash-based conditionals|^
|
||||
Map dispatch = int%fun[
|
||||
18 => <|writeLine("equal to 18"),
|
||||
19 => <|writeLine("yeah, it's 19")]
|
||||
Map dispatch ← int%fun[
|
||||
18 ⇒ <|writeLine("equal to 18"),
|
||||
19 ⇒ <|writeLine("yeah, it's 19")]
|
||||
if dispatch.has(i) do dispatch[i]() end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue