lua-users home
lua-l archive

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


Wow, release candidates go out really quick these days !

The current "LOADPATH?" thread made me remember of a small issue I
noticed a couple of months ago.
The new library function package.searchpath(name, path) should have
its second argument optional.
When not specified, it should look into package.path and
package.cpath, like function require().
Why? It can be so a easy way to know in which directory a module is
located, or to test (without a complicated pcall(require, ...)
construct) whether or not a module is installed.
And even for dofile, the package.path value can be a good default path.
Adding a default path is certainly of very little cost.