From f3c7b698fff7876cce26683beeee2e5e4e443962 Mon Sep 17 00:00:00 2001 From: Zuhaitz Date: Sun, 25 Jan 2026 10:46:18 +0000 Subject: Update pattern matching syntax in README --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'README.md') 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 -- cgit v1.2.3