[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (alpha-rc4) now available
- From: Patrick Rapin <toupie300@...>
- Date: Tue, 23 Nov 2010 23:06:29 +0100
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.