Examples of using Lua function in English and their translations into Portuguese
{-}
-
Colloquial
-
Official
-
Medicine
-
Financial
-
Ecclesiastic
-
Ecclesiastic
-
Computer
-
Official/political
Only Lua functions have environments.
Improved support for folding Lua functions.
To set the environment of a Lua function, use the variable_ENV or the function load.
They must be called through Lua, like a Lua function.
This event only happens while Lua is executing a Lua function.
Nested Lua functions are created sharing the environment of the creating Lua function.
To get the environment table of a Lua function, you call getfenv.
F can be a Lua function or a number that specifies the function at that stack level.
If there are no errors,lua_load pushes the compiled chunk as a Lua function on top of the stack.
Like a Lua function, a C function called by Lua can also return many results.
They are used as the default environment for nested Lua functions created by the function. .
Non-nested Lua functions(created by loadfile, loadstring or load) are created sharing the environment of the creating thread.
You can change the environment of a Lua function or the running thread by calling setfenv.
For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.
The semantics of these operations is better explained by a Lua function describing how the interpreter executes the operation.
Receives a Lua function on the top of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped.
The semantics of these operations is better explained by a Lua function describing how the interpreter executes the operation.
When you call a Lua function without a fixed number of results(see lua_call),Lua ensures that the stack has enough size for all results, but it does not ensure any extra space.
If the given function is not a Lua function, or if f is 0, getfenv returns the global environment.
In this case, only parameters of Lua functions are visible(as there is no information about what variables are active) and no values are pushed onto the stack.
What: the string"Lua" if the function is a Lua function,"C" if it is a C function,"main" if it is the main part of a chunk.
Environments associated with Lua functions are used to resolve all accesses to global variables within the function see§2.3.
Function lua_load has an extra parameter, mode.
The string mode works as in function lua_load.
As in Lua, this function may trigger a metamethod for the"newindex" event see§2.4.
The lua_load function uses a user-supplied reader function to read the chunk see lua_Reader.
You must call them like any other Lua CÂ function, e.g., by using lua_call.