Skip to content

Class: Function

Functional / Imperative programming function declaration. It is is composed by an identifier and one or more equations

Examples

ts
int foo (int bar) {
   return bar;
}
ts
def foo(bar):
   return bar

Constructors

Constructor

new Function(identifier, equations, loc?): Function

Parameters

ParameterType
identifierSymbolPrimitive
equationsEquation[]
loc?SourceLocation

Returns

Function

Overrides

ASTNode.constructor

Methods

getMetadata()

getMetadata<T>(key): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring

Returns

T

Inherited from

ASTNode.getMetadata


hasMetadata()

hasMetadata(key): boolean

Parameters

ParameterType
keystring

Returns

boolean

Inherited from

ASTNode.hasMetadata


setMetadata()

setMetadata(key, value): void

Parameters

ParameterType
keystring
valueany

Returns

void

Inherited from

ASTNode.setMetadata