Constants
Constants are declared with const. They can only be defined
at the module level (outside of functions).
Constant values can never be changed. You can also declare a single
constant separately:
V constants are more flexible than in most languages. You can assign more complex values:
* WIP - for now function calls are evaluated at program start-up
Global variables are not normally allowed, so this can be really useful.
Modules
Constants can be made public with pub const:
The pub keyword is only allowed before the const keyword and cannot be used inside
a const ( ) block.
Constants can be referenced without a module prefix from within the module where they are defined. To access a public constant from another module, prefix it with the module name.
Required module prefix
When naming constants, snake_case must be used. Outside the module where a constant is
defined, its full path must be specified. For example, use math.pi to access the public
pi constant from another module. Inside the math module, the unqualified name pi can
be used.