4 ms·
Thanks zverok. This helped me under stand pattern matching in Ruby better than any other articles I've read on the subject. I still don't really like it in Ruby
by joemi 3y ago
Thanks zverok. This helped me under stand pattern matching in Ruby better than any other articles I've read on the subject. I still don't really like it in Ruby (for some of the reasons pointed out in Irks And Quirks in this article) and don't think I'll be using it in my own Ruby programs (for now). But at least now I think I understand it well enough that I won't be totally confused when I see it show up in code. And I'll admit, I'm kind of intrigued by some possible use cases... specifically case-in seems like the way I'm most likely to one day use pattern matching.