Skip to main content

Functions

Functions are the core building blocks of a Fluency Programming Language script.

  • Each script must have a main function.
  • Allows custom, user defined functions
  • Many core functions / features are provided by built-in functions

Functions have must return some value

function <name> (parameters) { }

Custom functions

As a programming language, FPL allows arbitrary, user defined functions.


function main() {
let s = 100
return customFunction(s)
}

function customFunction(s) {
if (s > 100) {
printf("s is greater than 100")
} else {
printf("s is less than or greater to 100")
}
return {}
}

Built-in Functions

Many functions are provided by built-in functions. See the link (section) for a full listing of built-in functions.