-
Notifications
You must be signed in to change notification settings - Fork 0
Functions
Coding Cactus edited this page Aug 7, 2022
·
1 revision
Functions are declared using the fun
keyword and then the name of the function. After that, the parameters are listed within brackets as per the example. The return type is contained within the open function block arrow. To return from a function, use the return arrow <--
.
Example:
fun add(a -str|dec-, b -str|dec-) =str|dec=> <~~ str|dec means string or decimal types accepted / returned
<-- a + b <~~ returns a + b
<==