lua-users home
lua-l archive

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

On Tue, Oct 17, 2023 at 12:39 AM Pierre Chapuis <> wrote:
I was happy that to-be-closed variables ended up in Lua 5.4, even though I don't really like their interface (but I do not have a much better idea either). I think they should not be abused, and I do not particularly like <const>.

 <const> allows the compiler to evaluate constant expressions, at least if the constant is numeric. I agree about the syntax of <const> or <close>, but it's tricky to add a feature without adding keywords, so I can live with it.

In other words, I think to-be-closed variables is a very good addition to the language. Yes, you can shoot yourself in the foot if you try to do complicated things with them without a perfect understanding of how they work. The obvious solution is not to do that.

Any decently powerful language provides enough rope to hang yourself. It's up to the programmer to make judicious use of the features of the language.