How will that work with require? Remember it will only load the file once. =
Return false otherwise? (Which would be kinda compatible with the current b=
ehavior and using raise/throw). Or should those values be cached? If you wa=
nt to use require CommonJS-style, it has to be cached. But what about retur=
n values that depend on or provoke side effects? Should files support early=
 return?

Konstantin

On Jun 7, 2011, at 00:08 , Clifford Heath wrote:

> 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 =20
>>> other keyword (break, etc or a new one)
>>=20
>> This could be implemented as a method that raises an exception that =20
>> `require` and `load` rescue.
>> I'm not sure how compatible that would be with custom require =20
>> implementations (rubygems,
>> polyglot, etc)
>=20
> Polyglot will pass all exceptions except LoadError (or a subclass).
> With a LoadError, if it has no further possibility to satisfy the =20
> require,
> the original exception is re-raised. Thus, polyglot should not impede
> the implementation you propose.
>=20
> Clifford Heath.
>=20