Macros are similar to generic functions. They generate code inline wherever they are used.

// A macro that evaluates to the largest value
macro max[a, b]:
	imm aa = a
	imm bb = b
	if aa > bb {aa} else {bb}
	
// Now use it
fn tester(x i32, y i32):
  imm maxnbr = max(x, y)

Wherever the macro is used, its call site is effectively replaced with the logic of the macro, substituting all arguments wherever the macro's parameters are specified. A macro's logic must be syntactically complete and valid. Macros are hygienic: any names defined in the macro are inaccessible to the call site, and vice versa.

Notice that the 'max' macro captured its parameters into variables before using their values. This ensures each parameter's expression is only evaluated once. If this had not been done, both expressions would have been evaluated more than once, possibly to different values.

_