Files
orchid/examples/match/main.orc
Lawrence Bethlenfalvy f77e4fd90a October commit
- custom parser support and infra
- type-tagging and traits (untested)
- match expressions
2023-10-24 22:17:37 +01:00

22 lines
408 B
Plaintext

import std::to_string
const foo := t[option::some "world!", option::none]
const test1 := match foo {
t[option::some balh, option::none] => balh;
}
const bar := map::new[
"age" = 22,
"name" = "lbfalvy",
"is_alive" = true,
"species" = "human",
"greeting" = "Hello"
]
const test2 := match bar {
map::having ["is_alive" = true, "greeting" = foo] => foo
}
const main := test2 ++ ", " ++ test1