4 ms·
The entire set of string and enumerable methods. Extraordinarily useful. https://ruby-doc.org/core-3.0.3/Enumerable.html https://ruby-doc.org/core-3.0.3/Enumer
by burlesona 5y ago
The entire set of string and enumerable methods. Extraordinarily useful.
https://ruby-doc.org/core-3.0.3/Enumerable.html https://ruby-doc.org/core-3.0.3/Enumerable.html
https://ruby-doc.org/core-3.0.3/String.html https://ruby-doc.org/core-3.0.3/String.html
- codesections 5y agoThanks. I took a (somewhat quick) look and I'm pretty sure that Raku has equivalents for all of the Enumerable methods except for partition. (We could do basically the same thing with our classify[0] method by converting the Hash to an Array. Or do it manually with a reduce. But there are times when a partition method would be handy. [0]: https://docs.raku.org/type/List#routine_classify https://docs.raku.org/type/List#routine_classify The String methods might be offer a few more options, but I'll need to think more carefully about that. It's idiomatic (and supported with syntax) to use Regexes for at least some of those tasks in Raku. Plus, Raku's strings aren't directly iterable/indexable (though it's trivial to convert them to a list of characters), and Raku doesn't have a direct equivalent to a symbol (something that I do miss). I suspect that, even with those factors, there might be some ideas worth stealing in there, so thanks for the pointer. (Oh, and I know that it's "just" syntax, but for some reason I *really* like the idea of having an sprintf operator. I hadn't thought of a language doing that, but I just might borrow that one!)