4 ms·
Look at your case statement. In most languages, if you swapped the order of TUESDAY and _, you'd get different results. An actual declarative language would ch
by qbrass 12y ago
Look at your case statement. In most languages, if you swapped the order of TUESDAY and _, you'd get different results.
An actual declarative language would choose TUESDAY over _ because it's the most specific match, and not because it matched it first.
- kyllo 12y agoYes, good point, but this was not meant to be an example of declarative paradigm, just functional paradigm. It's SML, which is not a particularly declarative language. Haskell is a little bit more declarative but AFAIK its pattern matching works the same way as SML.