lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Monday 11 July 2005 10:52 am, Doug Currie wrote:
> Surely the intent was this:
>
> 1. try to load "foo.bar"
> 2. return if successful, but if "foo.bar" doesn't exist then try
> 3. require "foo" [i.e., recurse]
> 4. try to load "foo.bar" again
> 5. fail if "foo.bar" is not loaded
>
> This recursion is limited by the length of pathnames.

i hadn't thought this way, but sounds more sane.  i'd even omit step 4, then 
the semantic of success is that package "foo.bar" is loaded; no matter if it 
was a ..../foo/bar.lua or .../foo.lua or even .../foo.so the filename that 
was eventually found and loaded.

-- 
Javier

Attachment: pgpe0Om3snLqJ.pgp
Description: PGP signature