lua-users home
lua-l archive

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


thank you for your example - and just to be clear: I am perfectly fine with "local by default" and would not change anything in Lua 
 
my comment for your example below is that there is still some asymmetry:
the "global" in read is optional, nothing changes if omitted;
on the opposite the "global" in write is mandatory, does not work as intended if omitted

function read()
  global x
  return x
end
function write()
  global x
  x = 1
end

--
Andrea Vitali






_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org