From: Andrew Walrond Date: 2005-04-02T07:57:54+09:00 Subject: Re: Kernel.load() behaviour On Friday 01 April 2005 23:49, Saynatkari wrote: > Con fecha 1/4/2005, "Brian Mitchell" escribi�: > > > >One more idea that lets one use load and allows anonymous modules: > > > >glibc.rb: > >class Glibc > >end > > > >some_file.rb: > >module Packages > >end > > > >class Package > > def self.inherited(sub) > > Packages.const_set(sub.name.split("::").last, sub) > > end > >end > > > >load 'glibc.rb', true > > > ># Packages.constants == ["Glibc"] > > This will still pollute the namespace, though, at > the initial loading. That seemed to be Andrew's > concern. Not with load 'glibc.rb',true surely? On a related note, if glibc.rb does require(filename) or load(filename,false), this second level load breaks through and will pollute the top level global namespace. I suppose this is the obvious, though unwanted behavior. Andrew