lua-users home
lua-l archive

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




Hakki Dogusan <hakki@dogusan.net>于2019年6月6日 周四00:19写道:
Hi,

On 3.06.2019 14:13, Luiz Henrique de Figueiredo wrote:
>> local const x = 5
>> local toclose f = ...
>
> The only way to make this work is to add reserved words.
> Otherwise, these already have a meaning in Lua. They are equivalent to
>
> local const ; x = 5
> local toclose ; f = ...
>
>

local x = 5
setattribute(x, {const=true}) -- or setattribute(x, "const")
local f = ...
setattribute(f, {toclose=true}) -- or setattribute(f, "toclose")

No change required in syntax, may backward compatible...

Does it work?


--
Regards,
Hakki Dogusan

No, it doesn’t work. There are attributes for variables, but not for value.

--
regards,
Xavier Wang.