Syntax
iscclosure(func: function): booleanArguments
| Name | Type | Description |
|---|---|---|
func | function | Function value passed to C closure check. |
Returns
| Name | Type | Description |
|---|---|---|
isCClosure | boolean | true when C closure check returns true for the function; otherwise false. |
Description
Returns whether the provided function is a C closure. The argument must be a function; passing any other type raises a type error. The function does not inspect executor ownership, source, bytecode, or upvalues.
Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.
It returns isCClosure (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Check whether a function is a C closure.
local result = iscclosure(print)
print(result)