3 ms·
In my own library, I use inject instead of adding Array#sum. But, I know that's sidestepping the issue, not solving it. Honestly, I'm not sure how Rails uses
by Locke 18y ago
In my own library, I use inject instead of adding Array#sum. But, I know that's sidestepping the issue, not solving it.
Honestly, I'm not sure how Rails uses #sum. I'm not sure whether they really need it or not. I suspect not.
I'm not a big fan of a lot of non-standard additions to Ruby. For example, all the #try, or #returning, or even your #andand. I don't consider any of those to have enough intrinsic value to be worth the risk of collisions with someone else's subtly different implementation.
- raganwald 18y agoI'm not a big fan of a lot of non-standard additions to Ruby. For example, all the #try, or #returning, or even your #andand. I don't consider any of those to have enough intrinsic value to be worth the risk of collisions with someone else's subtly different implementation. #andand is soooooooo "raganwald." The Homoiconic Way is to use rewrite: #try, #returning, and #andand are all removed from your code and never conflict with other people's implementations ;-)