Re: Unclear grammar for global in 5.5

Roberto Ierusalimschy <[email protected]> Thu, 16 Jul 2026 09:47:29 -0300
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
> $ ./lua -e "global a; print()"
> ./lua: (command line):1: variable 'print' not declared

Please read the manual:

  "outside any global declaration, Lua works as global-by-default.
  Inside any global declaration, Lua works without a default:  All
  variables must be declared."

-- Roberto

-- 
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/20260716124729.GA8475%40arraial.inf.puc-rio.br.