Functions
You can make a simple function block with brace brackets.
{ print "Hello world!" }{
print "Hello world!"
print "DreamTode is the future!"
}When a function is expected, you can leave off the brackets.
print "Hello world!"Parameters
The => operator gives a function some parameters.
[a, b] => { return a + b }You can leave off the brace brackets and return for single-line functions.
[a, b] => a + bThe -> operator does the same thing, but the function won't return anything when called.
[name] -> print "Hello {name}"Calling
To call a function... put an array of arguments after it.
If a function takes no arguments, you can call it with an empty array.
Alternatively, you can use the : operator to place the first argument in front of the block.
Last updated
Was this helpful?