From d1b3124cf2ef0b8d88f7e996248779b08a519878 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 11 Dec 2024 00:28:28 +0000 Subject: Update example for struct positional fields --- examples/16-struct-positional-fields/src/HelloWorld.shed | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/16-struct-positional-fields/src') diff --git a/examples/16-struct-positional-fields/src/HelloWorld.shed b/examples/16-struct-positional-fields/src/HelloWorld.shed index ad6fe426..8880c7e2 100644 --- a/examples/16-struct-positional-fields/src/HelloWorld.shed +++ b/examples/16-struct-positional-fields/src/HelloWorld.shed @@ -4,12 +4,14 @@ pub fun main() ! Io -> Unit { print!(messageParts.part2); } +// We put part2 before part1 so that the order of args differs from the lexical +// field order. struct MessageParts( - part1: String, part2: String, + part1: String, ) { } fun getMessageParts() -> MessageParts { - MessageParts("hello, ", "world\n") + MessageParts("world\n", "hello, ") } -- cgit v1.2.3