From e3ca04abff63647322c283482af94331ed40edef Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 1 Jan 2022 14:27:09 +0100 Subject: [PATCH] pattern matching syntax idea --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fca305..4fb3973 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,19 @@ loop { Pattern matching! -```py +```rust # 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