Quantcast
Channel: Dave Copeland :ruby:
Viewing all articles
Browse latest Browse all 613

Article 1

$
0
0

Related to my previous question: return values from methods in Ruby

The new pattern-matching stuff does seem to have a theoretical advantage that you can simply return anything and use case to branch on what was returned. This avoids having to make some sort of explicit union-style class that you then ask “are you a failure?”

PRACTICALLY speaking however, NoMatchingPatternError has no info in it to debug a problem when no pattern matches. This seems bad.


Viewing all articles
Browse latest Browse all 613