lua-users home
lua-l archive

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


On Apr 8, 2014, at 12:18 AM, Christopher Berardi <cberardi32@gmail.com> wrote:

For one example of expressiveness, and I know its been beaten to death before, would be akin to Python's import statement:
    import module1
    import module2 as m2
    import module3, module4
    from module5 import func1, func2
    ...


I have the 'from' part implemented with a small function for Steve's LuaMacro:

    https://github.com/gvvaughan/larch

A matching 'import' macro would be similarly easy, and along with one of the
package.loaders larch ships, works almost invisibly (except for being an order
of magnitude slower than plain require)...

Disclaimer: larch is still half baked, but I use it to mitigate the otherwise
huge block of 'local foo = module.foo' statements at the start of every
file throughout my Specl project with some success, and in that case
pre-expand all the macros in the installed files to avoid the slowdown
and dependency on LuaMacro.

Cheers,
-- 
Gary V. Vaughan (gary AT vaughan DOT pe)