lua-users home
lua-l archive

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


On Wed, Aug 12, 2009 at 3:39 PM, Duncan Cross<duncan.cross@gmail.com> wrote:
>> If something looks like a function call, it should be a function call.
>> As this cannot be implemented as a function call, it should not look
>> like one.
>>
>
> I agree - I just wanted to fully understand what steve was suggesting
> first, he might have meant a real function that does the same thing
> somehow.

Fair enough, it is a pseudo-function.  I suppose I was thinking of t =
{explode(multiple()),10,20}; it is a pseudo-function because although
normally it means function(...) return ... end, it would then have
special semantics inside a table constructor.

Actually, the usual rule is confusing for beginners and experts alike
- that {multiple(),10} behaves differently from {10,multiple()}, and
that you have to use () for the second case to only insert the first
value returned.

steve d.