From: Pit Capitain Date: 2008-07-24T23:23:45+09:00 Subject: Re: circular 'require' 2008/7/24 Shadowfirebird : > I apologise if I seem to be complaining. No need to apologize, everybody should have the right to complain. I thought that you either hadn't read or tried what I wrote in my first mail and therefore got the (in my view) false impression that require was broken. That's the reason for my maybe too harsh an answer, sorry. > Pit, I think your solution is interesting because it imbeds a class > definition inside a class. Are there any downsides to that? Calling require inside a class definition or even inside a method doesn't embed the loaded constants (class names are constants too) into the "calling" class. It just changes the time when require is called. In your case, it would mean that require is called *after* creating the class Root, so that the required file can use that name. Sometimes I've seen code that requires certain files only if some method is called which needs the required functionality: def method_with_special_requirements require "rarely_used_library" use_the_required_functionality end This avoids the overhead of loading all the files everytime, even if the funcationality isn't used at all. Regards, Pit