newcclosure
Wraps a function in a C closure.
Syntax
Signature
newcclosure(Function: function) -> functionAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Function | function | Function called by the wrapper. |
Returns
| Type | Description |
|---|---|
function | New C closure recognized by isnewcclosure. |
Notes
The wrapper forwards arguments, return values, yields, and errors on the calling coroutine. Function may be a Luau or C closure.
Example
Luau
local Result = newcclosure(function() return 42 end)
print(Result)