[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: function foo() in table
- From: Duncan Cross <duncan.cross@...>
- Date: Mon, 21 Apr 2014 00:10:57 +0100
On Mon, Apr 21, 2014 at 12:00 AM, Andrew Starks <andrew.starks@trms.com> wrote:
> Because the:
>
> function x() end
>
>
> Syntax is short for:
>
> local x
> x = function () end
No it's not - you're thinking of:
local function x() end
Without that "local", it's exactly the same as regular assignment.
Anyway, I think it might be an idea worth considering, especially if
it also came with the optional syntax:
function :method() return self.x end
....to add the extra "self" parameter.
-Duncan