lua-users home
lua-l archive

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


On 15 May 2014 15:10, Andrew Starks <andrew.starks@trms.com> wrote:
> Hey all,
>
> With syntactic additions (`//`, `>>`, etc) in Lua 5.3, shimming
> modules is going to be more involved. Module writers will most likely
> need to adopt a functional version of these operators, or have code
> that does:
>
> ```lua
> local my_mod = {}
> my_mod.math_stuff = require(VER == '503' and 'my_mod.math_stuff_53" or
> "my_mod.math_stuff_5X")
>
> ```
>
> I think this won't be as compromise-free as it was in 5.1->5.2.
>
> I have observed other systems that provide specificity controls using
> directory structure, TeX being one example. Lua is the same, but it
> doesn't use this facility for versioning. Is there a possibility that
> this could be changed, given the coming need to do so?

On Unix, package.path and cpath are already versioned. Is it something
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

-- Hisham