lua-users home
lua-l archive

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


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