class Drizzle::AST::Function


Node representing a function definition. Functions are first-class in Drizzle, meaning that function names can be used as normal expressions.

The difference between what Drizzle does and what Monkey does is that in Monkey, the function literals themselves are expressions, whereas in Drizzle they are statements.

Defined in:



Instance Method Summary

Instance methods inherited from class Drizzle::AST::Node

literal : String literal, to_s : String to_s

Constructor Detail

def : Token, name : Identifier, params : Array(TypedIdentifier), ret_type : Identifier?, body : BlockStatement) #

[View source]

Instance Method Detail

The block making up the body of the function

[View source]
def literal : String #

[View source]

The Identifier node representing the name of the function

[View source]
def params : Array(Drizzle::AST::TypedIdentifier) #

An array of TypedIdentifiers representing parameters to the function

[View source]
def ret_type : Drizzle::AST::Identifier? #

The return type of the function

[View source]
def to_s : String #

[View source]
def token : Drizzle::Token #

The token that led to the creation of the node

[View source]