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

Argument Matching

To match call arguments with function or workbench parameters, µcad employs a process known as argument matching.

[!IMPORTANT] Parameters in µcad are not positional (which means their order is irrelevant)!

Instead of having so-called positional arguments, µcad has named arguments, which means that every parameter and every argument must have an identifier. Like x is in the following example:

test

fn f(x: Length) -> Length { x * 2 }

std::debug::assert_eq([f(x = 10m), 20m]);

Fortunately there are some facilities for your convenience, like:

All those are created to feel natural when using them together. If some explanations in the following sections may sound complicated, you might just go with the examples and "get the feeling".