aboutsummaryrefslogtreecommitdiff
path: root/examples/16-struct-positional-fields/src/HelloWorld.shed
diff options
context:
space:
mode:
Diffstat (limited to 'examples/16-struct-positional-fields/src/HelloWorld.shed')
-rw-r--r--examples/16-struct-positional-fields/src/HelloWorld.shed15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/16-struct-positional-fields/src/HelloWorld.shed b/examples/16-struct-positional-fields/src/HelloWorld.shed
new file mode 100644
index 00000000..ad6fe426
--- /dev/null
+++ b/examples/16-struct-positional-fields/src/HelloWorld.shed
@@ -0,0 +1,15 @@
+pub fun main() ! Io -> Unit {
+ val messageParts = getMessageParts();
+ print!(messageParts.part1);
+ print!(messageParts.part2);
+}
+
+struct MessageParts(
+ part1: String,
+ part2: String,
+) {
+}
+
+fun getMessageParts() -> MessageParts {
+ MessageParts("hello, ", "world\n")
+}