Table of Contents

Scala - Function

Syntax

def functionName ([list of parameters]) : [return type]

Signature

See Scala - Type

High Order

Higher order functions are functions that take a function as a parameter or return functions.

Evaluation

def square(x: Double)    // call by value
def square(x: => Double) // call by name
def myFct(bindings: Int*) = { ... } // bindings is a sequence of int, containing a varying # of arguments