Adam Shelly wrote: > On 3/2/06, renaud delbru <renaud.delbru / deri.org> wrote: >> > def self.print >> > class Test < A >> > end >> >> And the result during the execution : >> workspace/test-divers/main.rb:10: uninitialized constant Test >> (NameError) >> > > > Circular requires are a bad thing. > See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/178329. > > To avoid them, try the ruby equivalent of a forward declaration: In > test.rb, replace >> require 'main' > with >> class A; end ..or, if possible, try to not have both files referencing eachother. It is *usually* not necessary. > -Adam E -- Posted via http://www.ruby-forum.com/.