1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-06-26 06:29:28 +00:00

On the road to 1.0: Update multiple return value description

This commit is contained in:
David Schmenk 2017-06-01 14:06:44 -07:00 committed by GitHub
parent 3415077a2a
commit 6cdbcdd059

View File

@ -387,9 +387,7 @@ A value used as a function pointer doesn't have the parameter/return value count
word funcptr = @myfuncA
funcptr(2, 4)#3
```
If fewer values are returned, the remaining values will be padded with zero. It is an error to return more values than specified. Returning zero paramaters is ok, and can save some stack clean-up if the definition is called stand-alone (i.e. as a procedure).
Note: there is no mechanism to ensure caller and callee agree on the number of parameters. Historically, programmers have used Hungarian Notation (http://en.wikipedia.org/wiki/Hungarian_notation) to embed the parameter number and type in the function name itself. This is a notational aid; the compiler enforces nothing.
If fewer values are returned, the remaining values will be padded with zero. It is an error to return more values than specified. Returning zero values is ok, and can save some stack clean-up if the definition is called stand-alone (i.e. as a procedure).
After functions are defined, the main code for the module follows. The main code will be executed as soon as the module is loaded. For library modules, this is a good place to do any runtime initialization, before any of the exported functions are called. The last statement in the module must be done, or else a compile error is issued.