Skip to content
Snippets Groups Projects
Commit 47988fc6 authored by Ben Franksen's avatar Ben Franksen
Browse files

docs: clarified semantics of function definitions

parent b602ac80
No related branches found
No related tags found
No related merge requests found
...@@ -223,15 +223,21 @@ Function Definitions ...@@ -223,15 +223,21 @@ Function Definitions
Function definitions are very much like those in C. Function definitions are very much like those in C.
The most important difference is that functions declared in SNL get The most important difference is that functions declared in SNL get passed
passed certain implicit parameters. This makes it possible to call certain implicit parameters. This makes it possible to call built-in
built-in functions as if the code were a normal action block. functions as if the code were a normal action block. Note, however, that
there is currently no way to *pass* channel ("assigned") variables to SNL
Another difference from C is that SNL functions automatically scope over functions in such a way that you can call built-in functions on them. The
the whole program, no matter where they are declared. It is neither "assigned" status of such a variable is lost and it gets passes to the
necessary, nor is it allowed, to repeat the function declaration function as a normal C value. This means you can call built-in functions
(without the defining code block, commonly referred to as a "function that expect such a variable only if the variable was declared at the
prototype") at the top of the program. top-level. Lifting this limitation is planned for a future release.
Another difference from C is that SNL functions automatically scope over the
whole program, no matter where they are defined. It is not necessary (but
allowed) to repeat the function declaration (without the defining code
block, commonly referred to as a "function prototype") at the top of the
program.
Type Definitions Type Definitions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment