lua-users home
lua-l archive

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



Hi, all!

I find that table.insert returns nil instead of giving back the table.

While I am not usually given to complaining about "missing features" and
the all-to-common "why did you not do it the way _I_ want it" whining,
in this case I must say I am quite perplexed by Lua's behaviour.

Giving back the table as return value from table.insert would:
 - enable "sometable=table.insert(sometable or {},newelement)"
 - not break existing code
 - probably not significantly impact performance

So, why not?

Regards, Frank