Playing around with conditional syntax

This commit is contained in:
greg 2018-06-14 00:49:11 -07:00
parent ebcea685f3
commit e6679ff523
1 changed files with 19 additions and 0 deletions

19
TODO.md
View File

@ -1,6 +1,25 @@
# TODO Items
- if/match playground
simple if
`if x == 1.0 { "a" } else { "b" }`
one comparison multiple targets:
`if x == { 1.0 -> "a", 2.0 -> "b", else -> "c" }`
different comparison operators/ method calls:
`if x { == 1.0 -> "a", eq NaN -> "n", .hella() -> "h", else -> "z" }`
pattern matching/introducing bindings:
`if alice { .age < 18 -> "18", is Person("Alice", age) -> "${age}", else -> "none" }`
pattern matching w/ if-let:
`if person is Person("Alice", age) { "${age}" } else { "nope" }`
- Next priorities: - get ADTs working, get matches working
- inclusive/exclusive range syntax like .. vs ..=