define — Parametric operation (subprogram)Program & flow
Define a reusable, typed, defaulted operation — then call it by name.
define <name>(<p>: <unit> [= <default>], …) { … } · <name>(<p>=<value>, …)Equivalents: Fanuc M98 / G65 · Siemens CALL / L
| Parameter | Type | Default | |
|---|---|---|---|
name | ident | — | operation name |
p | typed param | — | dimensionally-checked parameter, optional default |
The native answer to subprograms — and a step beyond. Parameters are **dimensionally type-checked** (`slot(len=40)` is rejected if `len` is a length without a unit), can have **defaults**, and an axis can be driven by a parameter expression (`x=<param>`). The HMI lists defined ops in a palette and generates a **conversational call dialog** from the typed signature, with a live toolpath preview.
define slot(len: mm, depth: mm = 3mm, feed: mm = 300) {
g1 z=-depth f=feed
g1 x=len
g0 z5
}
slot(len=40mm, depth=5mm)See also: let