A design that subsumes the various syntactic forms of
if
statements/expressionsswitch
on valuesmatch
on patterns and pattern guardsif
-let
constructs
and scales from simple one-liners to complex pattern matches.
A design that subsumes the various syntactic forms of
if
statements/expressionsswitch
on valuesmatch
on patterns and pattern guardsif
-let
constructsand scales from simple one-liners to complex pattern matches.
How does $person get set?
Good catch, that should have been
if person
in the first line.It’s been a left-over from when syntax looked like this:
is Person("Alice", _)$person then "{$person.age}" is Person("Bob", $age) then "$age"