lua-users home
lua-l archive

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


You're right, close already implies const.

As for adding keywords: We could consider "soft" keywords (e.g. emitting "keyword-or-name" tokens and leaving the final decision to the parser), though I'm not sure whether that might introduce ambiguities.

Changing the syntax will break compatibility either way. But since the breakage is purely syntactical, this could be fixed automatically.

On 19.06.23 15:49, David Favro wrote:
On June 19, 2023 8:58:45 AM EDT, "Lars Müller" <appgurulars@gmx.de> wrote:
Since only local variables can have the close or const attributes,
these
attributes imply local and local becomes plain redundant. I would thus
prefer completely omitting the local keyword. [...]
const my_const = 42
close my_file = io.open(filename)
If there's going to be a change, this is the way to go.  Although added-keyword and breaking compatibility might be a drawback.

Of course this could still be
combined to form const close or close >const
Doesn't `close` already imply `const`?

-- David