One real use case I see would be avoiding global state (like CommonJS). How=
ever, if an already required file return nil, this is not possible.
On Jun 8, 2011, at 13:57 , Alex Young wrote:

> On 08/06/11 01:33, Yukihiro Matsumoto wrote:
>> Hi,
>>=20
>> In message "Re: [ruby-core:36811] Re: [Ruby 1.9 - Feature #4840][Open] A=
llow returning from require"
>>    on Tue, 7 Jun 2011 19:10:15 +0900, Yusuke ENDOH <mame / tsg.ne.jp> writ=
es:
>>=20
>> |Agreed.
>>=20
>> Ah, I understand the request.  But returning from outside of a method
>> makes me so weird.
>=20
> To me, return would imply that the returned value should be passed back
> by the original require call, like so:
>=20
> $ cat a.rb
> return 42
>=20
> $ cat b.rb
> p require("a")
>=20
> $ ruby -I. b.rb
> 42
>=20
>=20
> That could be *really* handy, although it's not compatible with my
> previous suggestion (currently languishing here:
> http://redmine.ruby-lang.org/issues/4523 - any comments?). An
> already-loaded file can still be signaled by a nil return value, and a
> file could pretend to be already loaded (if that's at all useful) by
> choosing nil as its return value...
>=20
> Food for thought :-)
>=20
> --=20
> Alex
>=20