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-6_modules-and-loading.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-6_modules-and-loading.md')
| -rw-r--r-- | docs/reference/03-6_modules-and-loading.md | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/docs/reference/03-6_modules-and-loading.md b/docs/reference/03-6_modules-and-loading.md index 4735d60..cb53cc1 100644 --- a/docs/reference/03-6_modules-and-loading.md +++ b/docs/reference/03-6_modules-and-loading.md @@ -36,10 +36,11 @@ inside it: (import* string) (print (str "my-module's value is " (require "my-module"))) - - #(output: - loading my-module... - my-module's value is 4) + +```output +loading my-module... +my-module's value is 4 +``` Often it is useful to export multiple values from a file, for example when writing a library containing multiple functions. There are two operators to @@ -65,10 +66,11 @@ rather the newly created scope. It can therefore be combined with [def][], (print (str "my-module/a-value is " my-module/a-value)) (my-module/print-doubled 4) - - #(output: - my-module/a-value is 7 - 4 doubled is 8) + +```output +my-module/a-value is 7 +4 doubled is 8 +``` [export*][] on the other hand operates on the containing scope rather than creating a new one. When Used without any arguments, it returns the containing @@ -92,9 +94,9 @@ mentioned are exported: (print (str "a is " a)) (print (str "b is " b)) (print (str "c is " c)) - - #(output: - a is 1 - b is 2 - reference error: undefined symbol 'c') +```output +a is 1 +b is 2 +reference error: undefined symbol 'c' +``` |
