@@ -23,7 +23,7 @@ embedding Rudi into other Go applications.
2323` func! ` creates a new function, which can be used in all subseqeuent statements
2424in the same Rudi program. Function creation is bound to its parent scope, so
2525defining a function within an ` if ` statement for example will make the function
26- available onside inside that statement, not globally.
26+ available only inside that statement, not globally.
2727
2828Dynamically defined functions cannot overwrite statically defined functions, i.e.
2929you cannot define a custom ` concat ` function using ` func! ` if ` concat ` already
@@ -34,6 +34,10 @@ Since defining a new function is a side effect, `func` must always be used with
3434the bang modifier (` func! ` ). The behaviour of Rudi programs that use ` func `
3535without the bang modifier is undefined.
3636
37+ Functions can contain an arbitrary number of expressions, which will be evaluated
38+ in sequence and share a single context. This means user-defined functions form
39+ a "sub-program" the same way the [ ` do ` ] ( core-do.md ) function does.
40+
3741## Examples
3842
3943```
@@ -56,12 +60,11 @@ inject a Go function statically into Rudi instead of defining it at runtime.
5660
5761## Forms
5862
59- ### ` (func! name:identifier params:vector body:expression) ` ➜ ` null `
63+ ### ` (func! name:identifier params:vector body:expression… ) ` ➜ ` null `
6064
6165* ` name ` is an identifier giving the function its name.
6266* ` params ` is a vector containing identifiers that hold the parameter names.
63- * ` body ` is a single expression (use ` do ` for multiple statements) that forms
64- the function body.
67+ * ` body ` is one or more expressions that form the function body.
6568
6669This form will create a new function called ` name ` with as many parameters as
6770` params ` has identifiers. ` params ` can be empty, but must otherwise contain only
0 commit comments