From: "ara.t.howard" Date: 2007-10-09T13:50:43+09:00 Subject: Re: The Open-Closed-from-a-certain-angle Principle On Oct 8, 2007, at 10:10 PM, Jay Levitt wrote: > What if class definitions were viewed through a magic prism, where > only > those classes looking from the right perspective saw the new > extensions? it's not too hard to imagine something like that: cfp:~ > cat a.rb module Namespace class File < ::File def self.xopen *a, &b open *a, &b end end def self.eval(&b) module_eval(&b) end end module Namespace File.xopen __FILE__ do |fd| puts fd.gets.scan(%r/\w+/).last end end cfp:~ > ruby a.rb Namespace cheers. a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama