<const> everywhere

"'Martin Eden' via lua-l" <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
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

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/969f3bf5-dd32-4756-a613-855838f6573d%40disroot.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.