lua-users home
lua-l archive

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

On 2017-09-06 05:26 AM, Daurnimator wrote:
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.

I'd rather them get escape sequences so I can use weird filenames with them. (see also: not being able to use ':' in PATH)

Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.