← All examples

One strike under two prefixes

areas:: and shapes:: are two strikes with their own types, so an areas::Circle is not a shapes::Circle.

one_strike_two_prefixes/strike.zg
# One strike under two prefixes (Synthia's renamed copy, owner 2026-09-30): `areas::` and `shapes::`
# are two strikes with their own types, so an `areas::Circle` is not a `shapes::Circle`. Both define
# the word operator `mean` for two bins: the path picks one, and a bare `mean` would clash
# (owner, 2026-10-02: the path settles it; 2026-10-06: a clash is refused where it is written).

MAIN {
    let 'a': areas::Circle = areas::Circle[radius = 1.0];
    let 'b': shapes::Circle = shapes::Circle[radius = 2.0];
    std::print.useful[areas::circle[lend 'a'], " ", shapes::circle[lend 'b'], newln];
    std::print.useful[1.0 areas::mean 3.0, " ", 1.0 shapes::mean.low 4.0, newln];
}
Output
3.14159 12.56636
2 2