diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-12-11 00:28:28 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-12-11 00:28:28 +0000 |
| commit | d1b3124cf2ef0b8d88f7e996248779b08a519878 (patch) | |
| tree | 2d5addc7092ef5b3ff30a0423c6e0c710ab2f30d /examples/16-struct-positional-fields/src | |
| parent | 6f11bbeab6957974b3b30018deb46ef8ecde258f (diff) | |
Update example for struct positional fields
Diffstat (limited to 'examples/16-struct-positional-fields/src')
| -rw-r--r-- | examples/16-struct-positional-fields/src/HelloWorld.shed | 6 |
1 files changed, 4 insertions, 2 deletions
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, ") } |
