abstract class Cosmo::Intrinsic::IFunction

Overview

An intrinsic function

Direct Known Subclasses

Defined in:

cosmo/runtime/intrinsic.cr

Constructors

Instance Method Summary

Instance methods inherited from class Cosmo::Callable

arity : Range(UInt32, UInt32) arity, call(args : Array(ValueType)) : ValueType call, expand_args(args : Array(ValueType)) : Array(ValueType) expand_args, intrinsic? : Bool intrinsic?, to_s : String to_s

Constructor Detail

def self.new(interpreter : Interpreter) #

[View source]

Instance Method Detail

abstract def call(args : Array(ValueType)) : ValueType #
Description copied from class Cosmo::Callable

Executes the function body, passing in args


[View source]
def intrinsic? : Bool #
Description copied from class Cosmo::Callable

Whether or not this function is intrinsic


[View source]
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]
def token(name : String) : Token #

Helper function to generate a fake token for logging


[View source]