mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
pattern matching syntax idea
This commit is contained in:
parent
8f7a1560a0
commit
e3ca04abff
1 changed files with 12 additions and 1 deletions
13
README.md
13
README.md
|
|
@ -121,8 +121,19 @@ loop {
|
||||||
|
|
||||||
Pattern matching!
|
Pattern matching!
|
||||||
|
|
||||||
```py
|
```rust
|
||||||
# design is still wip
|
# design is still wip
|
||||||
|
|
||||||
|
let obj = {};
|
||||||
|
obj.x = 5;
|
||||||
|
obj.y = "hey";
|
||||||
|
|
||||||
|
match obj {
|
||||||
|
{ no } => print "our thing didn't match here",
|
||||||
|
{ x, y } => print "we got it! " + x,
|
||||||
|
"test" => print "string 'test'",
|
||||||
|
other => print "something else: " + other,
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`dilaria` is dynamically and *strongly* typed
|
`dilaria` is dynamically and *strongly* typed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue