summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuhaitz <zuhaitz.zechhub@gmail.com>2026-01-25 10:46:18 +0000
committerGitHub <noreply@github.com>2026-01-25 10:46:18 +0000
commitf3c7b698fff7876cce26683beeee2e5e4e443962 (patch)
treedc2d0df6cb912ec6e8811ba344f2ef358f84df27
parent2852e409a1acd55104aa8ed7679c566192c88607 (diff)
Update pattern matching syntax in README
-rw-r--r--README.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/README.md b/README.md
index b968964..c6ed5d5 100644
--- a/README.md
+++ b/README.md
@@ -350,14 +350,14 @@ var y = x > 10 ? 1 : 0;
Powerful alternative to `switch`.
```zc
match val {
- 1 => print("One"),
- 2 || 3 => print("Two or Three"), // OR with ||
- 4 or 5 => print("Four or Five"), // OR with 'or'
- 6, 7, 8 => print("Six to Eight"), // OR with comma
- 10..15 => print("10 to 14"), // Exclusive range (Legacy)
- 10..<15 => print("10 to 14"), // Exclusive range (Explicit)
- 20..=25 => print("20 to 25"), // Inclusive range
- _ => print("Other")
+ 1 => { print "One" },
+ 2 || 3 => { print "Two or Three" }, // OR with ||
+ 4 or 5 => { print "Four or Five" }, // OR with 'or'
+ 6, 7, 8 => { print "Six to Eight" }, // OR with comma
+ 10 .. 15 => { print "10 to 14" }, // Exclusive range (Legacy)
+ 10 ..< 15 => { print "10 to 14" }, // Exclusive range (Explicit)
+ 20 ..= 25 => { print "20 to 25" }, // Inclusive range
+ _ => { print "Other" },
}
// Destructuring Enums