Martin Eden
unread,Apr 15, 2026, 12:44:33 AMApr 15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lu...@googlegroups.com
Hello guys,
I'm writing new code in Lua 5.5 and trying that new "<const>"
attribute for declarations. In short
local <const> a, b = 1, 2
blocks writing to "a" and "b".
And
local a <const>, b = 1, 2
blocks writing to "a".
That "<const>" is spreading just like "local":
local <const> MyModernFunction = function() end
local <const> MyModernTable = {}
For my case more than half use cases can be marked "<const>".
Maybe we can have "<var>" to mark write-enabled locations and
make "<const>" default?
(Like my wish to have "local" attribute as default.)
-- Martin