From: Kent Dahl Date: 2002-12-14T04:11:52+09:00 Subject: Re: require circularity? James Davis wrote: > > I'm wondering if it is ever necessary to do something like this: > > unless defined? SomeName then > require 'somename' > end > > in case source files require each other. Thanks in advance, In general, no. Ruby is wa-ah-ay better than C and C++ . 'require' will only load in the file if it hasn't already been loaded. However, I think there was some thread a while back on a few pathological cases where 'require' didn't save the day. One was the case of reaching the same .rb file from different paths (i.e. require 'somename' versus require '/usr/lib/ruby/somename'). I think there was one more pathological case, but I can't seem to remember it nor find it on ruby-talk. But these are pathological, ergo they are only likely show up when you're getting too clever for your own good. :-) -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)