lua-users home
lua-l archive

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

On 26 February 2011 23:19, David Manura <> wrote:
> On Sat, Feb 26, 2011 at 5:54 PM, Reuben Thomas <> wrote:
>> [on package.config] What's wrong with a table?
> Also asked in [1].
> [1]

Indeed, and not answered.

I've just added the following interface to stdlib's io_ext module:

-- Reflect package.config (undocumented in 5.1; see luaconf.h for C
-- equivalents)
local _
_, _, dirsep, pathsep, path_mark, execdir, igmark =
  string.find (package.config,

(note that strictly you can't just index the string: there's nothing
to guarantee that each "element" is a single character)

This means that I can now use

io.dirsep, io.pathsep, io.path_mark, io.execdir, io.igmark

Following the principle of least surprise, the names are just
lower-cased versions of the macros in luaconf.h.

Release in a few minutes!