Quirrel4.41.0

types.Class.getfuncinfos

Method on every class
class.getfuncinfos(): any

Describes the class's _call metamethod, the same way function.getfuncinfos describes a plain function.

examples/types/class/getfuncinfos-basic.nut
class Blaster {
  function _call(target) { return target != null }
}
let info = Blaster.getfuncinfos()
println("info.name =", info.name)
Output:
info.name = _call

Return value

null if the class defines no _call metamethod. Otherwise the same introspection table debug.get_function_info_table would build for that metamethod closure: name, parameters, defparams, required_params, varargs, native, and the rest.

Notes

This is about _call, the operator that makes an instance of the class callable like a function - not about constructor, which is a plain method and never consulted here. A class with no _call gets null even though every class has a constructor.

Example

examples/types/class/getfuncinfos.nut
class Plain { x = 1 }
println("Plain.getfuncinfos() =", Plain.getfuncinfos())
Output:
Plain.getfuncinfos() = null

See also

getmetamethodLooks up one of the class's metamethods by name, without triggering it.
getfuncinfosDescribes this instance's class's _call metamethod, the same way function.getfuncinfos describes a plain function.
getfuncinfosReturns a table describing the closure: its name, parameters, and other introspection data the VM tracks for it.
get_function_info_tableReturns meta information about a function as table
classclass index