Call a function: Difference between revisions

Content added Content deleted
Line 389: Line 389:
}
}


getNumber: { 3 }
getNumber: -> 3


// Calling a function that requires no arguments
// Calling a function that requires no arguments
Line 401: Line 401:


// Using a function in statement context
// Using a function in statement context
if true { printHello ~ }
if true -> printHello ~


// Using a function in first-class context within an expression
// Using a function in first-class context within an expression
if [getNumber ~]=3 { "yep, it worked" }
if [getNumber ~]=3 -> "yep, it worked"


// Obtaining the return value of a function:
// Obtaining the return value of a function: