Quirrel4.41.0

function

Methods on every closure.

Functions

acallfunction.acall(args: array): anyCalls the closure with the arguments taken from an array: args[0] becomes this, and the rest of args becomes the closure's own parameters.
bindenvfunction.bindenv(env: table|instance|class): anyReturns a copy of the closure with env statically bound as its this: every future call to the copy uses env, no matter how it is called.
callfunction.call(...): anyCalls the closure, using env as its this and forwarding the rest of the arguments as its own parameters.
cloneclone(): anyReturns the closure itself: unlike a table, array or class instance, a closure has no separate clone identity.
getfreevarfunction.getfreevar(index: int): anyReturns the name and current value of one of the closure's free variables (the outer locals it captured when it was created).
getfuncinfosfunction.getfuncinfos(): anyReturns a table describing the closure: its name, parameters, and other introspection data the VM tracks for it.
pacallfunction.pacall(args: array): anyCalls the closure like acall does, taking this and the arguments from an array: args[0] becomes this, and the rest of args becomes the closure's own parameters.
pcallfunction.pcall(...): anyCalls the closure like call does, using env as its this and forwarding the rest of the arguments as its own parameters.
tostringtostring(): anyReturns a string that names the type and identity of the closure.
weakrefweakref(): anyReturns a weak reference to the closure.