Zeen Modules
Modules
Section titled “Modules”Modules in Zeen are just source code files with a .zn extension. The name of the module is just the file name without extension (no extra declarations required).
Mostly module can look like this:
fn main() { let calculation = 2 + 2 * 2;
@println("Result: {}", calculation);}Code separates into 3 different levels:
- Declarations - top level code description (functions, structures, interfaces, etc.)
- Statements - members of declarations, contains executable sequence (annotations, assigns, calls, etc.)
- Expressions - little elements of data operating (like arithmetic, comparison, literals annotation, etc.)
We can split up our previous code with these levels:
// Declarations Level
// `main` is a function declarationfn main() { // Statements Level
// annotation statement let calculation = 2 + 2 * 2 /* value expression */;
// macro call, // 2 expressions arguments: string literal, variable reference @println("Result: {}", calculation);}Project Setup
Section titled “Project Setup”Use the Zeen package manager - Zora.
See examples and more info in: Package Manager
