lua-users home
lua-l archive

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


Hi:

On Sat, Sep 8, 2018 at 6:24 AM, Sam Pagenkopf <ssaammp@gmail.com> wrote:
> It would break everything, but I'd remove the top-level function keyword
> entirely, with the side effects. 2 more keystrokes for `=` in free
> functions, plus 4 for `self` in methods.
....
> I'm also reasonably sure that you could convert any valid lua program using
> the top-level function keyword into a valid one with the other syntax.
> Correct me if I'm wrong on that, edge cases are always fun.

Well, if I read correctly (5.3 ref manual, 3.4.11 function definitions
) all "top level" function keyword usages are syntactic sugar with a
translation defined there, so it's easy to be sure. You could remove
it, but normally it is called syntactic sugar instead of
syntactic-PITA for a reason.

F.O.S.