Functions & closuresReference
isnewcclosure
Identifies wrappers created by the module.
Details#
Checks whether a function is one of the module's newcclosure wrappers. An arbitrary C closure is not necessarily such a wrapper.
Signature#
isnewcclosure(target: function): booleanParameters#
| Parameter | Type | Description |
|---|---|---|
target | function | The exact function value to inspect or modify. |
Returns#
A boolean result; non-function arguments raise a type error.
Examples#
Example
local f = newcclosure(function() return 1 end)
print(isnewcclosure(f)) -- true