From: Yohanes Santoso Date: 2002-02-22T09:19:12+09:00 Subject: Re: recursive require Ron Jeffries writes: > I'm having a really odd thing happen with two files that mutually > require each other, and I'm hoping for help. > I had this problem too. I think these three solutions are obvious: 1. Protect the 'require' like in C: test.rb: if loaded == 0 loaded=1 bla bla bla whatever that was in test.rb bla bla bla end 2. Use forward declaration test.rb: class Code end Code.something() 3. Refactor so that 'test' uses the interface of 'code'. Personally, I like solution #2 because it's easy and fast. I put all the forward declarations in a separate file which is 'require'd by both code.rb and test.rb. YS.