lua-users home
lua-l archive

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


On Wed, 5 Jun 2019 at 15:30, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
>
> On Wed, 5 Jun 2019 at 15:08, Matthew Wild <mwild1@gmail.com> wrote:
> >
> > On Wed, 5 Jun 2019 at 12:53, szbnwer@gmail.com <szbnwer@gmail.com> wrote:
> > > Ryan Ford:
> > > >  I'm sure this would break the current syntax though as you would be initializing the local "resource" and assigning a new value to the global "x"
> > >
> > > if `resource` is a keyword, then it wont mess with anything, and no
> > > new stuff will be usable in older versions, no matter what.
> >
> > As the maintainer of a >50k-line Lua codebase that extensively uses
> > local variables named "resource", I beg to differ with the "it won't
> > mess with anything" assertion.
> >
>
> Hi as I already explained in a previous post, there is no need for a
> new keyword.
> The parsing of:
>
> local <resource> x
> local resource x
>
> are the same - both utilize the fact that after local a variable name
> is expected, so anything in between can be easily parsed especially if
> they are just identifiers.
> Hence the markers are superfluous - at least for the proposed extensions.

I don't see how the parser can determine whether I mean:

  local resource x = foo()

to be interpreted as
  local <toclose> x = foo()
or
  local resource; x = foo()

Regards,
Matthew

Regards,
Matthew