From: Magnus Holm Date: 2011-06-07T00:00:27+09:00 Subject: [ruby-core:36793] Re: [Ruby 1.9 - Feature #4840][Open] Allow returning from require I think using "return" is quite natural in this case, as long as we can use it in module/class-definitions too. // Magnus Holm On Mon, Jun 6, 2011 at 16:18, 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), but it would obviate the need for a new keyword or commandeering an existing one. > > Michael Edgar > adgar@carboni.ca > http://carboni.ca/ >