Syntax
islclosure(func: function): booleanAliases
isluaclosureArguments
| Name | Type | Description |
|---|---|---|
func | function | Function to test. |
Returns
| Name | Type | Description |
|---|---|---|
isLClosure | boolean | true when the function is a Lua closure; otherwise false. |
Description
Returns whether the provided function is a Lua closure. The argument must be a function; passing a non-function raises a type error. isluaclosure is an alias.
Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.
It returns isLClosure (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Check whether a function is an L closure.
local function target()
end
print(islclosure(target))