On Mon, Jan 19, 2004 at 01:25:01PM +0900, Phil Tomson wrote: > Another issue that was raised was that Ruby doesn't have effective methods > (or at least not as effective as other languages have) of avoiding > namespace collisions. For example, when we 'include' a module we get all > of the methods in that module imported into the current > namespace. What if we could optionally list the methods/classes we want > to include, similar to Python's import: > > import Blah func1,func2,MyClass IMHO this handles a pretty benign issue, as methods in the current class will be preferred to those of a mix-in. It does nothing to solve the following, however: module Bar # idiotic code def foo 1 + bar(1, 2, 3) end def bar(*a) 1 end end class Foo include Bar # , :foo def bar # changing the interface "bla" end end Foo.new.foo # booboo And in the following case... module Foo def foo; ...; bar; ...; end def bar; ... end end module Bar def bar; ... end end class A include Bar include Foo, :foo # bar too? end > This imports the methods func1 and func2 and the class MyClass from Blah. > Perhaps similar options could be added to 'require'. I cannot think of any meaningful semantics for require 'foo', :blah. > Thoughts? Is this necessary? Is it advisable? What problem does include Bar, :bla solve in addition to 'feature deficit'? -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com <SomeLamer> what's the difference between chattr and chmod? <SomeGuru> SomeLamer: man chattr > 1; man chmod > 2; diff -u 1 2 | less -- Seen on #linux on irc