[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Location of a package
- From: eugeny gladkih <john@...>
- Date: Mon, 18 Feb 2008 23:45:02 +0300
>>>>> "RI" == Roberto Ierusalimschy <firstname.lastname@example.org> writes:
>> It's unfortunate that the package finder function isn't exposed in Lua by
>> the native package lib. I hope it will be done
>> in Lua 5.2.
>> Metalua needs it, and reimplements it. Look at function package.findfile()in
>> http://repo.or.cz/w/metalua.git?a=blob_plain;f=src/lib/package2.lua, and
>> give it your package's name as first arg,
>> package.cpath or package.path as a second arg, depending on whether your
>> module is in C or in Lua. Don't
>> forget to close the file handle if you don't use it.
RI> Lua 5.2 will include a package.searchpath function. It is similar
RI> to this package.findfile, but it returns only the file name (not the
RI> file handler).
Roberto, is there any description of upcoming changes in Lua 5.2?
Yours sincerely, Eugeny.
Doctor Web, Ltd. http://www.drweb.com