[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Location of a package
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 19 Feb 2008 08:56:44 -0300
>> Lua 5.2 will include a package.searchpath function. It is similar
>> to this package.findfile, but it returns only the file name (not the
>> file handler).
> I recall a discussion about splitting the 'require' logic in two parts. I
> don't remember if it was on the Kepler dev's list or here. Anyway, it was
> about decoupling the process of finding a module from the actual loading of
> the module. Surely someone who took part in that discussion will be reading
> Will issues like this be addressed in Lua 5.2 ?
'require' already decouples its process of finding a module, using
loaders. This new function package.searchpath will easy the task of
writing new loaders. (E.g., both the C loader and the Lua loader are
just calls to searchpath.)