Clarify private module functions/variables.

This commit is contained in:
Stephen Chung 2020-09-10 17:42:53 +08:00
parent fed65676a2
commit c7de72aba2

View File

@ -43,6 +43,9 @@ export x as answer; // the variable 'x' is exported under the alias 'answer'
} }
``` ```
[`private`] variables are used to initialize the module.
They cannot be used apart from this.
Functions Functions
--------- ---------
@ -59,6 +62,9 @@ fn inc(x) { x + 1 } // script-defined function - default public
private fn foo() {} // private function - hidden private fn foo() {} // private function - hidden
``` ```
[`private`] functions are commonly called to initialize the module.
They cannot be called apart from this.
Sub-Modules Sub-Modules
----------- -----------