Y
Hacker News
new
|
ask
|
show
|
jobs
by
nsajko
2193 days ago
You choose to interpret a
switch statement
through an
if statement
, but that's arbitrary: the other way around is also possible (interpreting/rewriting an if-else construction as switch statements).
1 comments
jfkebwjsbx
2193 days ago
The point of GP is that the match assumes an equality test and it does it against a single object too.
There is no way in many languages to write an if using a match.
link
There is no way in many languages to write an if using a match.