ReferenceClosures

islclosure

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

Syntax

islclosure(func: function) -> boolean

Also available as

isluaclosureis_l_closure

Parameters

ParameterTypeDescription
funcfunctionThe function to check.

Returns

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

Description

It is the opposite of iscclosure. A Luau function has bytecode, constants and upvalues you can read with getconstants and getupvalues; a C function has none of these.

Example

local function add(a, b)
    return a + b
end

print(islclosure(add))
print(islclosure(print))

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