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)
SourceInstance methods
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
definition
Sourcereturn_typedef
Sourceto_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.