[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Proposal: package.(c)path as tables
- From: Daurnimator <quae@...>
- Date: Wed, 6 Sep 2017 18:26:46 +1000
At the moment, package.path and package.cpath are strings containing
semicolon separated lists.
I'd like to propose that they are transitioned to be sequences to
allow for easier programmatic manipulation.
The environment variables LUA_PATH, LUA_PATH_5_4, LUA_CPATH, etc
wouldn't change: they'd just need to be parsed when the package
library is loaded.
In the next release we can allow package.path and package.cpath to be
strings for compatibility.
However the construct `package.path = package.path ..
";/my/path/?.lua" would break and need to be changed to
`table.insert(package.path, "/my/path/?.lua")`
If this breakage is too much, perhaps we could have three phases:
- phase 1. we allow table form, but still use string form on lua
command line application load.
- phase 2. we change the default to be table form; string form is deprecated
- phase 3. we remove support for string form.