lua-users home
lua-l archive

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


The recursive definitions are something I didn't consider. If you were to enable recursion in local function assignments. it would be strange because it violates scoping rules. I think the most complete and useful answer would be a shorthand for `local x x = `, whatever that may be. No longer a removal, but a replacement.

On Sun, Sep 9, 2018 at 4:47 AM Francisco Olarte <folarte@peoplecall.com> wrote:
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.