Start work on functions

This commit is contained in:
2025-08-11 14:57:45 +10:00
parent 3a8600b481
commit db0c362efb
2 changed files with 66 additions and 16 deletions

View File

@@ -232,7 +232,21 @@ Some symbols specific to this category:
Defines a function. All code between `fun` and `endfun` will be included in the function.
Usage: `fun !functionname -type &var -type &var -type &var # and so on...`
Usage: `fun -type !functionname -type &var -type &var -type &var # and so on...`
Usage note: The first type specified before the function name must be the return type. The type displayed before all vars
#### local
Defines a variable. The variable will be destroyed when the function is finished.
Usage: `local &var $value`
#### return
Returns back to the main program (or other function that called this function). Also returns a value, which must be of the type defined when defining the function.
Usage: `return $value`
#### endfun