lua-users home
lua-l archive

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


On Tue, Dec 18, 2012 at 12:42 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> Yes. Containing `split` and `wrap`, which mesh well with Array.
> Containing some tree functions, like `flatten`, which takes
> {{1,2,{3,4}},5} to {1,2,3,4,5}.

Well, naturally split() occurs in both namespaces ;)

>  Containing `structured_like` (or some better name) which does the opposite.

Yeah, 'restructure' is an interesting function, but how generally
useful? Or (to put it in a better) way, is it a spare part that can be
usefully composed with other parts?

> about Microlight in February than I do now.  It's simple: I've
> been off Python for ten months longer.

Congratulations!  Penlight has also become less Pythonistic under the hood.

> for e.g. `class`, `callable`, `map` and `filter` any more. I find it
> more readable to write the equivalent in plain Lua.

Currently I have a little thing for string lambdas, like so

A{{1,10},{2,20}}:map '_[1]'  -> {1,2}

or arr:sort '_1.name < _2.name'

Not that I expect this will be universally adopted.  But it is no less
valid Lua style than writing out the for loop diligently, and no less
efficient.

steve d.