From: nobu.nokada@... Date: 2004-08-30T09:44:59+09:00 Subject: Re: silly question Hi, At Mon, 30 Aug 2004 09:29:04 +0900, Ferenc Engard wrote in [ruby-talk:110908]: > > > module X > > > def X.foo; puts "foo"; end > > > end > > > > > > module Y > > > include X # what to write here? > > > def bar; foo(); end # want to call X.foo > > > end > > > > > > Is it even make sense? > > > > You can do it in Ruby, and it makes a lot of sense. Refer to the > > pickaxe for details > > http://phrogz.net/ProgrammingRuby/tut_modules.html#mixins > > That description deals with normal mixin functionality, using instance > methods. Here I want to use a module method in another module (or class) > without qualifying it. X.foo isn't an instance method but a singleton method of X, that is, it's defined for nothing but X. So you can never call it without X. -- Nobu Nakada