4 ms·
Ah, it's an ugly, verbose syntax for pattern matching. Got it :-)
by megaman22 9y ago
Ah, it's an ugly, verbose syntax for pattern matching. Got it :-)
- pivo 9y agoWell, it's very similar to Scala's pattern matching. Not as elegant as Erlang or Haskell's. Objective-C, which is what Swift is being compared to here, doesn't have pattern matching. An attempt to write something similar in Objective-C would be much more verbose, unsafe and almost certainly uglier.
- Grustaf 9y agoYou may find it ugly, that's subjective - I personally find it weird and unintuitive. But you can't really say it's verbose, there is no redundant information there.