On 17.03.2008 00:12, Sean O'Halpin wrote: > On Sun, Mar 16, 2008 at 9:30 PM, Robert Klemme > <shortcutter / googlemail.com> wrote: >> Yeah, but you can achieve the functionality without modules at all - at >> the small cost of defining a single instance method in class Module. > > I suspect that Trans is looking for a general principle to follow and > is using equality as an example (but I'm open to be corrected of > course :) Maybe. IIRC he did not state this. > While adding a single method to Module may seem like a small cost if > you're only using it in a single program, > it becomes unsustainable when you're managing a large public library > like Facets which is trying to play nice with frameworks like Rails > (which doesn't go out of its way to be polite). Agreed. But that's a different story - I reacted to a very concrete question. Maybe it was my fault to not read it as a more general question - OTOH the original question was rather short and you can read it both ways IMHO. > With the unbridled rise in Ruby 'metaprogramming', a zillion monkeys > are leaving their cr**p all over Object, Module and Class. > I thoroughly endorse any effort to avoid namespace pollution. Agreed. > Also, Ara's point about unintended constant propagation is a very good > one. I recently got stung by an otherwise innocent VERSION constant > which screwed up all manner of unrelated things. Yeah, but happens only if you include modules. My point here was that the same behavior can be achieved by a single method in class Module. And in this particular case (defining equivalence) it is so general that it should even be part of the std lib. No module inclusion, no constant propagation. > So my tuppence worth goes towards something like Ara's version of the > module inclusion method. "tuppence" LOL - was this a typo or is it a common idiom I haven't seen before? (Sounds a bit like these plastic boxes...) Kind regards robert