class

Cosmo::Function

Inherits Cosmo::Callable / Reference / Object

Constructors

new(interpreter : Cosmo::Interpreter, closure : Cosmo::Scope, definition : Cosmo::AST::Node, class_instance : Nil | Cosmo::ClassInstance = nil)
Source

Instance methods

arity

The amount of parameters this function will accept

Source
call(args : Array(ValueType), return_type_override : String = return_typedef.lexeme, class_instance_override : ClassInstance | Nil = @class_instance) : ValueType

Executes the function body, passing in args

Source
definition
Source
intrinsic?

Whether or not this function is intrinsic

Source
return_typedef
Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source