Modules
// Module is an extension, which is a combination of between language and implementation.
Using module
To use a module, just with a use
keyword.
The above statement will load math module and math
identifier will be a local variable. By default, math module return a map that contains static functions and properties.
Alias
Using module with another name, or many module have special name, alias is a great way to deal with them.
Declared variables of use statement are immutable, so you cannot assign value to them.
You should declare using of modules in top of your code.
Creating module
We have two ways to create a module:
1. By code
Create a new file named my-module.m.aup
And use it
Run with aup
If module not found, the compiler will stop and show error.
Pass option -m path/to/module
to tell compiler finds module.
2. With C++
It is not strange at all, because aup is written in C++ 😄
// todo, we'll provide it soon
Last updated