> -----Original Message----- > From: David Simmons [mailto:pulsar / qks.com] > Sent: Wednesday, October 24, 2001 3:09 AM > To: ruby-talk ML; undisclosed-recipients: > Subject: [ruby-talk:23145] Re: Bruce Eckel's opinion of Ruby > [SmallScript/AOS Selector Namespaces] > > [deleted David's incredibly cool explanation] > so...in Ruby it could be explained as: module A class Foo def bar "The bar is for drinking" end def bar2 "More drinking!" end end end module B include A class Foo def bar "The bar is for beer nuts" end end end module C include A class Foo def bar "The bar is for picking up da' ladies" end end end #Now, if you enter the namespace of B include B #and build a Foo f = Foo.new print f.bar # => "The bar is for beer nuts" print f.bar2 # => Exception...no method found ^--This does not work today! TODAY: In the namespace identified by module B, f.bar2 does not exist because in B when you define class Foo you are not just replacing the module A Foo class method "bar", but creating a whole new class Foo in B. TOMORROW: With David's selector namespaces, when in the scope of module B your definition of class Foo would modify Foo (from module A) in the context of module B, and module C would modify Foo (from module A) in the context of C and "bar2" would exist in all (three) namespace instances of Foo, but each would have a different "bar" method. Whew! Is that right David? -Rich