aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-09-17 19:42:59 +0100
committerMichael Williamson <mike@zwobble.org>2023-09-17 19:42:59 +0100
commit9a61ec7d9a85e396b99f2727f226b680f8159d59 (patch)
tree3c2503c0a96b40c4bd57a6abaf599323a7ef0ceb /examples
parent136bc83f98c9eeda4cc18d90c6c29839622b5759 (diff)
Add tuples example
Diffstat (limited to 'examples')
-rw-r--r--examples/11-tuples/shed.toml9
-rw-r--r--examples/11-tuples/src/HelloWorld.shed9
2 files changed, 18 insertions, 0 deletions
diff --git a/examples/11-tuples/shed.toml b/examples/11-tuples/shed.toml
new file mode 100644
index 00000000..156fa7c6
--- /dev/null
+++ b/examples/11-tuples/shed.toml
@@ -0,0 +1,9 @@
+[shed]
+main = "HelloWorld"
+
+[[shed.bins]]
+name = "hello-world"
+
+[[shed.examples]]
+bin = "hello-world"
+expected-output = "hello, world"
diff --git a/examples/11-tuples/src/HelloWorld.shed b/examples/11-tuples/src/HelloWorld.shed
new file mode 100644
index 00000000..46c22ba8
--- /dev/null
+++ b/examples/11-tuples/src/HelloWorld.shed
@@ -0,0 +1,9 @@
+fun main() ! Io -> Unit {
+ #(val part1, val part2) = messageParts();
+ print!(part1);
+ print!(part2);
+}
+
+fun messageParts() -> #(String, String) {
+ #("hello, ", "world\n")
+}