lua-users home
lua-l archive

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


pocomane,

If you introduce a new keyword "const", the following script will not work anymore in the new lua:

local const = 2
print(const)

Thank you! now I got it!

However, there are always incompatibilities, see the corresponding section in the reference manuals of Lua 5.x. 
So why this incompatibility is deemed not acceptable?

Even if there is the incompatibility, it seems very easy to fix. Just search the source code for "const" and change it where needed.
And finally, we could check how frequent "const' is in the existing codebase, so we can estimate how much of it will be broken in case we adopt "const".
It may turn out that really there is no problem with the old code because no one was using "const".

The only thing that I do not like is that this would be a new keyword and I do not like adding too many keywords to the language. Lua is minimalistic and I like it as it is.
Anyway I would prefer not to use the angle brackets <const>.

"local const a = 1" or "const a = 1"

is indeed cleaner and would be closer to the overall cleanliness of the language source code

thank you very much anyway for answering my question

   Andrea

--
Andrea Vitali