From: Avdi Grimm Date: 2001-07-25T12:09:10+09:00 Subject: [ruby-talk:18499] Re: OO question > use 'byte_and_bit_access' // ok - bad name > > and String and Array would be augmented with unpack and > pack. Very interesting idea; it sounds like something I've been ruminating on lately. Ruby's ability to dynamicly extend classes at runtime seems to lend itself to a new model for library inclusion. I've always been vaguely uneasy about constructs such as "Parsedate.parsedate()", "Math.cos()", "Find.find()"... etc. in any of the languages in which they are found. It's repetetive; and it seems like a case of confusing classes with namespaces to me. Ruby on the other hand offers the unique oportunity for libraries to dynamicly extend existing classes, rather than adding pseudo-namespaces. So I could say "require 'ParseDate'"; and the parsedate() method would be added to the Date class and/or the time class. Or I could say "require 'Math'"; and the appropriate numeric types would magicly acquire "cos()" and "log()" methods. On the other hand, this opens up a whole realm of potential namespace clashes, when two libraries both try to add the same method to the same class... well, food for thought, anyway. -Avdi Grimm