Function Library
Stof's standard function library ("Function").
Common Value Functions
Function.toString(func: fn): str
Returns a string with this function's ID, helpful at times for debugging.
Function.or(func: fn, ...): unknown
Returns the first non-empty (null or void) argument, just like the Standard Library "or" function.
Library Functions
Function.call(func: fn, ...): unknown
Call this function, passing in any arguments given, in order.
Function.name(func: fn): str
Return the name of this function.
Function.parameters(func: fn): vec
Returns a vector containing this function's parameters (a Tuple of (name: str, type: str)
).
Function.returnType(func: fn): str
Returns this function's return type (typeof).
Function.attributes(func: fn): map
Returns a map of the attributes that exist on this function.
Function.hasAttribute(func: fn, key: str): bool
Returns true if this function has an attribute with the given key.
Function.object(func: fn): obj
Return the first object that this function is attached to.
Function.objects(func: fn): vec
Return a vector of all of the objects that this function is attached to.
Last updated