You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can declare and define a function using the fn
keyword, then the name of the function and then a list of
argument declarations inside parenthesis. After the
declaration, you must define a body for the function.
Every statement is separated by a new line and the
body ends with a semi colon. (see Syntax Rules)
giving in Boink is what is called returning in other
languages.
Usage
You can declare a give type using the arrow operator (->), if no give type
was declared, the function doesn't have a give type (much like a void function in C).
There are 2 rules:
If a function has a give type, it must give at some point.
If a function doesn't have a give type, it can't return.