[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: changes in 'require'
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 13 Jul 2005 11:23:16 -0300
> require"a.b.c.d"
> try a.b.c.d
> if not found, implicitly require"a.b.c.xxx"
> try preload a.b.c.d
[...]
> It's an optimized mix of the fixed name idea with Doug's "go up on
> failure and retry" approach.
What do you mean by "optmized"?
If it is going to use a.b.c.xxx, why not start trying it? It eliminates
the need to "retry" a.b.c.d. It is much simpler (less steps, no ifs):
require "a.b.c.d"
try "a.xxx"
try "a.b.xxx"
try "a.b.c.xxx"
really require "a.b.c.d"
(In practice we seldom use four levels of nesting...)
-- Roberto