lua-users home
lua-l archive

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



On Thu, May 15, 2014 at 1:58 PM, Hisham <h@hisham.hm> wrote:
>
> On Unix, package.path and cpath are already versioned. Is it something

Actually, this would be consistent on any platform that supports directories.

> like this that you're suggesting?
>
> Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
>> print(package.path)
> ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua

Almost, but not quite. I'm suggesting that the non-versioned variant should be in there too, which would support writing modules in such  a way that you could provide specific version support on a file-by-file basis.

From my earlier post:

lroot/5.3/?.lua;lroot/5.3/?/init.lua;lroot/?.lua;lroot/?/init.lua;./?.lua;./?/init.lua
-------------------------------------------^
(not sure if text alignment is my friend here or not)

Notice the lack of `/5.3/` at this highlighted point. The same could also be true for CPATH, as well.

-Andrew