diff options
| author | s-ol <s+removethis@s-ol.nu> | 2022-01-27 13:28:07 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 3a8d30dbd116eb6a6239a6c0411ad26de9614527 (patch) | |
| tree | d93abe76ac71e36e3a80b7d674db6ae38d68c66f /docs/reference/03-3_functions.md | |
| parent | docs: update extension guide (PureOp) (diff) | |
| download | alive-3a8d30dbd116eb6a6239a6c0411ad26de9614527.tar.gz alive-3a8d30dbd116eb6a6239a6c0411ad26de9614527.zip | |
docs: show output samples on dark background
Diffstat (limited to 'docs/reference/03-3_functions.md')
| -rw-r--r-- | docs/reference/03-3_functions.md | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/reference/03-3_functions.md b/docs/reference/03-3_functions.md index 917b8d4..6715eb7 100644 --- a/docs/reference/03-3_functions.md +++ b/docs/reference/03-3_functions.md @@ -11,6 +11,10 @@ code, amongst other things: (add-and-trace 1 2) (add-and-trace 3 4) +```output +trace (+ a b): <num= 3> +trace (+ a b): <num= 7> +``` Here a *function* `add-and-trace` is defined. When defining a function, first the names of the parameters have to be given. The function defined here takes @@ -38,11 +42,10 @@ example is equivalent to the following: (let a 3 b 4) (trace (+ a b))) - -and the output of both is: - - trace (+ a b): <num= 3> - trace (+ a b): <num= 7> +```output +trace (+ a b): <num= 3> +trace (+ a b): <num= 7> +``` In `alv`, functions are first-class values and can be passed around just like numbers, strings, etc. However it is very common to define a function with a |
