Re:If-then-else had to be invented
by eat_veggies on Sunday December 13, 2020 @09:31AM
(#25406771)
Is pattern matching a generalization of if/then/else, a reframing of it, or something else entirely?
[ Parent
| on HN ]
Re:If-then-else had to be invented
by colejohnson66 on Sunday December 13, 2020 @09:33AM
(#25406794)
I see it as a cross between a switch and if statement. You’re saying based on what `x` is (a switch), do these things that a switch can’t do (an if).