From: Ron Jeffries Date: 2002-02-22T21:19:50+09:00 Subject: Re: recursive require On 22 Feb 2002 02:54:38 -0800, Yohanes Santoso wrote: >Here are three files, abc.rb, xyz.rb, and global.rb. abc contains >class Abc, and xyz contains class Xyz. Abc and Xyz are >inter-dependant. Putting "require 'xyz'" in abc.rb and "require >'abc'" in xyz.rb will not work as you pointed out. > >So, pre-declare class Abc in xyz.rb and pre-declare class Xyz in >abc.rb. However, rather than putting the declaration everywhere, >collect them into a file: global.rb. > >Then, from abc.rb and xyz.rb require global.rb OK, I think I'm getting the idea. You're saying that the "other" file doesn't need to know all the definitions of the classes in the first file, it just needs to know that they are classes, so we put "dummy" class definitions in global.rb, and that's all anyone else needs to know. Yes? I assume that's your idea. In either case, thanks for the idea! Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.