newcclosure
Wraps a function in an executor C closure.
Arguments and return values are forwarded. The native entry validates the optional name but does not pass it to the wrapper constructor; do not depend on it setting a debug name.
newcclosure(callback: function, name: string?): functionParameters
| Parameter | Type | Description |
|---|---|---|
callback | function | Function the wrapper forwards calls to. |
name | string? | Optional name argument accepted by the current interface. |
Example
local wrapped = newcclosure(function(value) return value * 2 end)
print(wrapped(4), iscclosure(wrapped))Example output
8 true