Rule 175p-dyn-module
Evaluation of Programs
(175)
Comments
A module is evaluated once, after every module it imports, and its top-level values are evaluated then, whether or not they are used: every top-level declaration has its default copy, even when nothing uses it. A main in a module other than the main module is evaluated in the same way, once, as an ordinary value.
TeX source
\defnrule[r:p-dyn-module]
{\jdg{\pgBdyn}{\modm}{\pgBdyn',\VE}\premsep
\jdyn{\pgBdyn+\pgBdyn'}{\program}{v}}
{\jdyn{\pgBdyn}{\modm\ \program}{v}}Tests (2)
- elm / EntryMainOfRootModuleTestA program's entry point is the `main` of the module being compiled, even when an imported module also defines and exposes a `main`.
- elm / StandardA82MainInImportedModuleTestA `main` in a module other than the main module is an ordinary value, of any type.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:p-dyn-module] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.