~sircmpwn/hare-dev

harelang.org: fix glitches in tagged unions/match example v1 SUPERSEDED

Phil Pennock: 2
 fix glitches in tagged unions/match example
 fix glitches in tagged unions/match example

 2 files changed, 8 insertions(+), 8 deletions(-)
#465335 .build.yml failed
Send a new patch in its own thread, please. You put the context-specific
details in the commit message, too, and they belong in the timely
commentary instead (after the ---)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/21327/mbox | git am -3
Learn more about email & git

[PATCH harelang.org] fix glitches in tagged unions/match example Export this patch

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

diff --git a/content/tutorials/introduction.md b/content/tutorials/introduction.md
index 61ec5fc..589d8fe 100644
--- a/content/tutorials/introduction.md
+++ b/content/tutorials/introduction.md
@@ -765,8 +765,8 @@   # 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);
      		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"),
      	};
@@ -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

Re: [PATCH harelang.org] fix glitches in tagged unions/match example Export this patch

Alexey Yerin caught that the match block was also using println instead
of printfln.  Adjusted patch for that.
---
 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
Send a new patch in its own thread, please. You put the context-specific
details in the commit message, too, and they belong in the timely
commentary instead (after the ---)