[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 #... proposal and patch.
- From: Dirk Laurie <dpl@...>
- Date: Mon, 2 May 2011 12:01:35 +0200
On Mon, May 02, 2011 at 11:21:05AM +0200, Xpol Wan wrote:
> As a beginner of Lua, I do think select("#", ...) is not elegant enough.
The moment something in Lua is not elegant, it usually means that
one should not be doing it that way.
I can think of only one unavoidable application for select("#", ...),
unfortunately one for which an example is to be found in the standard
library (table.insert), and that is when the calls
myfunc(a,b)
myfunc(a,b,nil)
involve different semantics for a and b.
A beginner of Lua would do well to avoid writing such functions.
Dirk