4 ms·
You can also use sth like Map<List<Boolean>, Result> in languages with no pattern matching. Sadly map literals aren't pretty in some of these languages, but it'
by ajuc 6y ago
You can also use sth like Map<List<Boolean>, Result> in languages with no pattern matching. Sadly map literals aren't pretty in some of these languages, but it's still better than a bunch of nested if-then-elses or switches.
- exdsq 6y agoGood point! I don’t see why languages don’t adopt pattern matching (unless the grammar really breaks it for whatever reason)