Syntax
newlclosure(func: function, debugName?: string): functionArguments
| Name | Type | Description |
|---|---|---|
func | function | Function to wrap as a Luau closure. |
debugName? | string | Optional debug name assigned to the created closure. |
Returns
| Name | Type | Description |
|---|---|---|
closure | function | Created closure function. |
Description
Creates an executor-owned Luau closure from a function.
Call it with 2 parameter(s): func, debugName. The argument table explains which values are required and which ones only refine the behavior.
It returns closure (function). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = newlclosure(function() end, "example")
print(result)