A simple pure function
The complete source of functions_simple.ek9, compiled by the EK9 compiler. Shown on functions.html.
#!ek9 defines module site.functions.simple defines function multiplier() as pure <- value as Float: 5.6 defines program ShowSimpleFunction() stdout <- Stdout() stdout.println("The multiplier is " + $ multiplier()) calculatedResult <- 6 * multiplier() stdout.println(`The result is ${calculatedResult}`)
Output
The multiplier is 5.6 The result is 33.599999999999994