[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: function foo() in table
- From: Tim Hill <drtimhill@...>
- Date: Sun, 20 Apr 2014 16:40:37 -0700
On Apr 20, 2014, at 3:44 PM, Marc Lepage <mlepage@antimeta.com> wrote:
> I was wondering if there was a reason we cannot do syntax g (below) in a table. It seems like that would be handy.
>
> t = {
> 1, 2, 3,
> a='a',
> b='b',
> f=function() print 'f' end,
> function g() print 'g' end,
> }
>
> I'm sure there's a reason, I'm just curious.
>
> Marc
Personally I find the existing assignment form much clearer anyway, since this is a case where functions are *clearly* first class values and this is nicely reflected in the syntax.
—Tim