Almost Alpha
Massive improvements across the board. One day I'll adopt incremental commits.
This commit is contained in:
23
examples/protocol/main.orc
Normal file
23
examples/protocol/main.orc
Normal file
@@ -0,0 +1,23 @@
|
||||
protocol animal (
|
||||
const noise := vcall "noise"
|
||||
)
|
||||
|
||||
type dog (
|
||||
const new := \name. wrap name
|
||||
impl super::animal := map::new [
|
||||
"noise" = \dog. "${dog}: Woof!"
|
||||
]
|
||||
)
|
||||
|
||||
type cat (
|
||||
const new := wrap 0
|
||||
impl super::animal := map::new [
|
||||
"noise" = \_. "a cat: Mew!"
|
||||
]
|
||||
)
|
||||
|
||||
const main := do {
|
||||
list::new [dog::new "Pavlov", cat::new]
|
||||
|> list::map (\a. println $ animal::noise a)
|
||||
|> list::chain exit_status::success
|
||||
}
|
||||
Reference in New Issue
Block a user