~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH harelang.org v2] Correct tutorial example of tagged unions/match

Details
Message ID
<20210322012820.1279266-1-sourcehut@phil.spodhuis.org>
DKIM signature
missing
Download raw message
Patch: +5 -5
---
Alexey Yerin caught that the match block was also using println instead
of printfln.  Adjusted patch for that.

Sorry for the bad first attempt at a v2, it's been too many years since
I last used a pure git-send-email flow.  I forgot what's what.

 content/tutorials/introduction.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/content/tutorials/introduction.md b/content/tutorials/introduction.md
index 61ec5fc..bb0bdd4 100644
--- a/content/tutorials/introduction.md
+++ b/content/tutorials/introduction.md
@@ -765,10 +765,10 @@   # TODO: We're going to expand the syntax for tuples later
      	let x: (str | int | example | void) = "Hello!";
      
      	match (x) {
      		s: str  => fmt::println("x is a str: {}", s);
      		i: int  => fmt::println("x is an int: {}", i);
      		example => fmt::println("x is example"),
      		void    => fmt::println("x is void"),
      		s: str  => fmt::printfln("x is a str: {}", s),
      		i: int  => fmt::printfln("x is an int: {}", i),
      		example => fmt::printfln("x is example"),
      		void    => fmt::printfln("x is void"),
      	};

      	x = example;
@@ -778,7 +778,7 @@   # TODO: We're going to expand the syntax for tuples later
      		example => -1,
      		*       => abort(),
      	};
      	fmt::println("y is {}", y);
      	fmt::printfln("y is {}", y);
      };
  details: |
      One of the most important features of Hare is **tagged unions**. These are
-- 
2.31.0
Details
Message ID
<CA3XYQNC7FS2.35B0EFCSET5CR@taiga>
In-Reply-To
<20210322012820.1279266-1-sourcehut@phil.spodhuis.org> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/harelang.org
   c373b16..df006e1  master -> master
Reply to thread Export thread (mbox)