From: Michael Schuerig Date: 2002-11-04T03:18:39+09:00 Subject: Re: Namespace hygenie ts wrote: >>>>>> "M" == Michael Schuerig writes: > > M> I very much like the ability to extend existing classes, but I > don't M> want to inflict my changes on others. > > Look if import-module do what you want > > http://www.ruby-lang.org/en/raa-list.rhtml?id=108 I'm not sure if I understand it correctly, but I don't think it can do what I want. Here's an exemplary case ## File myexts.rb module MyExts class String def starts_with(s) index(s) == 0 end def ends_with(s) index(s, -(s.length)) != nil end def without_prefix(p) return self unless self.starts_with(p) self[p.length..-1] end end end ## File somelib.rb require 'myexts' module SomeLib def some_method(s) if s.starts_with("...") ... end end end ## File libuser.rb require 'somelib' class C include SomeLib ... end Now, within libuser.rb I don't want the definitions from myexts.rb to be visible. Michael -- Michael Schuerig If at first you don't succeed... mailto:schuerig@acm.org try, try again. http://www.schuerig.de/michael/ --Jerome Morrow, "Gattaca"