lua-users home
lua-l archive

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


On Wed, Nov 20, 2013 at 4:08 PM, Fabien <fleutot+lua@gmail.com> wrote:
> I think it would be more idiomatic to have it replace the table's content
> in-place, leaving it up to the caller to copy the table or not before
> modifying it. But then we face a recurring problem: it's surprisingly hard
> to agree on a general proper way to copy a table in Lua.

Oh yes, I remember when we all tried ;)

But (just as a data point) it's amazing what LuaJIT can do with code
that any Lua programmer would see as 'inefficient'.

For instance, have a look at Lua Fun:

http://rtsisyk.github.io/luafun/intro.html

Will work on stock Lua (with one small change). But the generated
machine code for that 'functional' expression is most impressive.

Whether it is more _readable_ I leave as another question...

steve d.