This commit is contained in:
2026-06-23 17:22:41 +02:00
parent f16f352d1e
commit 2f68fc966a
16 changed files with 809 additions and 38 deletions
+30
View File
@@ -0,0 +1,30 @@
animals :: import "./animals"
State :: enum(u16) {
started = 10
running
stopped = 20
}
initial State :: State.started
same :: func(left State, right State) bool {
return left == right
}
identity :: c_func(value State) State {
return value
}
main :: func() i32 {
state State = identity(.running)
values [2]State :: [.started, State.stopped]
animal animals.Animal :: animals.Animal.dog
if same(state, .running) and
values[0] != values[1] and
animal != animals.favorite() and
initial == State.started {
return 0
}
return 1
}