abstract class Cosmo::Callable

Direct Known Subclasses

Defined in:

cosmo/runtime/types/function.cr

Instance Method Summary

Instance Method Detail

abstract def arity : Range(UInt32, UInt32) #

The amount of parameters this function will accept


[View source]
abstract def call(args : Array(ValueType)) : ValueType #

Executes the function body, passing in args


[View source]
def expand_args(args : Array(ValueType)) : Array(ValueType) #

Expands any Spreads in the argument list


[View source]
abstract def intrinsic? : Bool #

Whether or not this function is intrinsic


[View source]
abstract def to_s : String #
Description copied from class Object

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.


[View source]