[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1+ and variable-argument tables
- From: Rici Lake <lua@...>
- Date: Fri, 20 Aug 2004 17:02:20 -0500
On 20-Aug-04, at 4:52 PM, Roberto Ierusalimschy wrote:
The ... syntax, on the other hand, creates an odd sort of
pseudo-datatype which is not a first-class object at all, [...]
The ... syntax does not create this pseudo-datatype. It already exists
in the language, in the form of multiple returns. I agree that its
second-class nature is not elegant, but it proved a quite useful and
efficient mechanism.
Well, tuple-as-function creates no new datatype either.
Actually, I think multiple return values are fantastic. I hate
programming
in languages that don't have them. But I don't think they are even a
second-class datatype, any more than parameter lists are a datatype (in
Lua).
"...", on the other hand, is providing a name for a non-object, which
is why
I called it a pseudo-datatype.
My argument is that tuples-as-functions are more useful and while
possibly not as efficient as ..., much more efficient than
varargs-as-tables, which is probably efficient enough (imho).
Tastes vary, of course.
Rici