lua-users home
lua-l archive

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


On Fri, Feb 17, 2012 at 8:40 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> It's must a great module of lua!

Since people have said such nice things to me I've made a new version,
at a more convenient home:

https://github.com/stevedonovan/Microlight

Some things have not made the cut, like tmap (mapping over lists is
much more common) and intersect. I've also left out the safe/throw
function wrappers since it's an unusual usage.

The table dumper generates prettier output, but at the cost of
guaranteeing good serialized output (e.g. {function=true}). Mostly
intended as a debug aid at this point.

'update' is now called 'import', and without a second argument it
imports ml itself. If the second arg is a string, it tries to use
require() (thanks to Dirk for this suggestion)

> require 'ml'.import()
> import(_G,"lfs")

(there's a little overloading going on here which I'm not sure about.

'set' is still there, but now called 'makemap'.

> = makemap {'a','b','c'}
{a=1,c=3,b=2}
> = makemap ({'a','b','c'},{1,2,3})
{a=1,c=3,b=2}

It still does fine as a set-maker, but has other superpowers as well!

It turns out that bind2 is very useful, since many Lua functions have
the table or string as their first argument. imap2 sneaked in as well.

I am not convinced that this is the best name, maybe llib or lualib is
better. I still want to use Moonlight for a project name, but maybe I
should keep that back.

The readme.md is fairly extensive, and hopefully covers most of the ground.

steve d.