Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Inline modules

Inline modules are modules are defined with the mod keyword, followed by a name and a body {...} as the following example shows:

test

mod my_module {
    // e.g. define a constant
    pub const VALUE = 1;
}

The following statements can be used within an inline module:

StatementPurposeExample
const assignmentnaming constantsconst Y = 1;
pub assignmentexporting constantspub Y = 1;
functionseparate calculationsfn f() { }
workbenchbuild or transform 2D sketches and 3D partspart P() { }
modulemodularization of complex codemod m { }
useuse elements from other modulesuse m;
commentfor documentation//! comment