ReferenceClosures

iscclosure

Checks whether a function is implemented in C rather than written in Luau.

Syntax

iscclosure(func: function) -> boolean

Also available as

is_c_closure

Parameters

ParameterTypeDescription
funcfunctionThe function to check.

Returns

TypeDescription
booleantrue for a C function, false for a Luau function.

Description

Built-in functions such as print and math.floor are C functions, as are the wrappers newcclosure returns. Functions written in a script, including your own, are Luau functions. The answer is the opposite of islclosure for every function.

Example

print(iscclosure(print))
print(iscclosure(function() end))
print(iscclosure(newcclosure(function() end)))

These are Game executor contracts. Check build requirements and session lifetimes before using them.