Re:Ruby 2.0 Refinements in Practice
by davnola on Tuesday November 30, 2010 @04:50AM
(#1953639)
Can anyone please explain why ruby-core prefer refinements over classboxes?
[ Parent
| on HN ]
Re:Ruby 2.0 Refinements in Practice
by steveklabnik on Tuesday November 30, 2010 @09:36AM
(#1954179)
I'm no expert on classboxes, but there's some info here: http://timeless.judofyr.net/refinements-in-ruby (control-f for 'classb')
I'd imagine that some of the reason is due to the fact that this is already implemented, but classboxes are not. I don't know anything about ruby-core, so I don't know how much that'd matter to them, but an almost identical but implemented feature seems much better than a more pure but unimplemented one.
The proposer suggests here http://goo.gl/4P4Wa (slide 39) and here http://goo.gl/p7ReQ that local rebinding violates the expectations of the callee, but it just seems to me to be very unintuitive.