[Ironruby-core] require infinite loop

Tomas Matousek Tomas.Matousek at microsoft.com
Wed May 14 02:13:14 EDT 2008

Well, it is not so simple. Currently we check whether the file is already in $". But it doesn't get into the list until it's execution is successfully finished:

p $"
require 'y.rb'
p $"

p $"

The output is:

So we probably need another list/table of already loaded files. Besides, a single file could be required multiple times - if you do $".clear before calling require. I need to figure out what is exactly the condition under which Ruby doesn't load a file. Could you please file a bug?


From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Wayne Kelly
Sent: Tuesday, May 13, 2008 10:23 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] require infinite loop

With the latest version, if a ruby source file requires itself, or if there is a cyclic chain of requires so that the original source file is required again - it results in an infinite loop.

This used to work correctly in the previous version - it simply requires marking the file as already loaded prior to executing it.

Cheers, Wayne.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080513/cef5e4fd/attachment.html>

More information about the Ironruby-core mailing list