Special variables: Difference between revisions

→‎{{header|Lua}}: How to list global variables in Lua, explain _G and _VERSION
(jq)
(→‎{{header|Lua}}: How to list global variables in Lua, explain _G and _VERSION)
Line 840:
=={{header|Lua}}==
 
*; arg -: global table containing command line parameters with the name of the program at index 0. Not available in interactive mode
; _G : the table with the ''global environment'', i.e. all global variables, including itself and the other variables listed here
; _VERSION : string with the name of the interpreter and the major and minor version, e.g. "Lua 5.2"
 
To list all global variables:
 
<lang lua>for n in pairs(_G) do print(n) end</lang>
 
The list will include built-in global functions, whose availability depends on the implementation and compile time configuration.
 
=={{header|Mathematica}}==
Anonymous user