Closures

isnewcclosure

Returns whether a function was created by newcclosure.

Syntax

isnewcclosure(func: function): boolean

Arguments

NameTypeDescription
funcfunctionFunction to test.

Returns

NameTypeDescription
isNewCClosurebooleanTrue when the function was created by newcclosure.

Description

Returns whether a function was created by newcclosure.

Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.

It returns isNewCClosure (boolean). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = isnewcclosure(function() end)
print(result)