[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: about table.insert return value (==nil)
- From: frank <frank@...>
- Date: Sun, 20 Dec 2009 15:23:34 +0100
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