From: Clifford Heath Date: 2011-06-07T07:08:33+09:00 Subject: [ruby-core:36804] Re: [Ruby 1.9 - Feature #4840][Open] Allow returning from require On 07/06/2011, at 12:18 AM, Michael Edgar wrote: > On Jun 6, 2011, at 10:11 AM, Rodrigo Rosenfeld Rosas wrote: >> It would be great to allow return from a required file or some >> other keyword (break, etc or a new one) > > This could be implemented as a method that raises an exception that > `require` and `load` rescue. > I'm not sure how compatible that would be with custom require > implementations (rubygems, > polyglot, etc) Polyglot will pass all exceptions except LoadError (or a subclass). With a LoadError, if it has no further possibility to satisfy the require, the original exception is re-raised. Thus, polyglot should not impede the implementation you propose. Clifford Heath.