import std::io; enum word: u8 { a, b, c, first = word::a, last = word::c } enum next: u8 { start = word::last, d, e, stop = next::e } def name(w: word): int { return match w { first => 1, b => 2, last => 3 }; } def main(): void { println($"{word::first} {word::last as u8} {word::first == word::a} {2 as word}"); println($"{next::start as u8} {next::d as u8} {next::stop} {name(word::c)} {name(word::a)}"); }