From: Mark Hahn Date: 2001-11-01T01:45:11+09:00 Subject: [ruby-talk:23983] Re: Overiding a method in another module ts> but I'm not really sure that it's a good idea to give ts> the possibility to have ::Class. Any thought ? I am not a language design expert. I can only see a problem that I have and I think this problem is a valid one. I think maybe that no current OO technique can solve my problem. ::Class would help my problem. Why would ::Class be bad? ts> * def Class#method .. end ?? ts> * def Foo::Bar::baz() .. end ?? Aren't both of these just shortcuts for: class Class def method end end -- and -- module Foo def Bar::baz end end I cannot give opinion on whether shortcuts are useful or not. They do not change what I can do, so I don't care very much. -----Original Message----- From: ts [mailto:decoux@moulon.inra.fr] Sent: Wednesday, October 31, 2001 8:08 AM To: ruby-talk ML Cc: ruby-talk@ruby-lang.org Subject: [ruby-talk:23973] Re: Overiding a method in another module >>>>> "M" == Mark Hahn writes: Well, the response was given by another person, just a small precision M> module M2 M> class M1::C1 <=== gives syntax error This is in the ToDo * class Foo::Bar VCALL dump NEWLINE <./b.rb:3> MODCLASS A SCOPE NEWLINE <./b.rb:3> MODCLASS B SCOPE NEWLINE <./b.rb:3> DEFN method SCOPE ARGS(a) NEWLINE <./b.rb:6> MODCLASS A SCOPE NEWLINE <./b.rb:6> DEFS CONST C method SCOPE ARGS(b) ./b.rb: uninitialized constant C at A (NameError) pigeon% What others think about these 2 syntax (def Class#method(), def A::B::method()) ? Usefull or not ? Guy Decoux