Skip to main content

Functions

Declared with define … taking …. Multiple parameters are joined with and, not commas.

define add taking a and b
return a + b

show add(10, 20) // 30 — calls use commas, declarations use "and"

A function with no return statement, or whose body finishes without reaching one, implicitly returns nil. Calling a function with the wrong number of arguments raises a runtime error naming the function, its arity, and the count received.