[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ... as an "expand list" unary postfix operator
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 12 Aug 2009 15:53:57 +0200
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.