lua-users home
lua-l archive

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


On Sun, May 24, 2020 at 8:40 PM Andrea wrote:
> Local pi is const = 3.14
> Local handle will close = fopen()

The Xavier proposal works because it reuses an already existing
keywords. With "is" and "will" you will face the
backward-incompatibilities we already saw in another recent thread.

The sole way I see to solve the new-keyword issue "Generally", is to
extent its namespace with something that before was forbidden (but do
not change the identifier one). The <> syntax is a particular case of
this method, applied to a very specific context, but it can be made
very general. For example, we could allow ":" as a final character in
keywords. Then you can invent

local pi is: const = 3.14

or

local pi const: = 3.12

or

tab = {0}
delete: tab 0

or any other funny keyword, without the risk of incompatibility.
Obviously a prefix can be used instead

local pi :const = 3.14

ore more "Readable" simbol

local pi @const = 3.14