aboutsummaryrefslogtreecommitdiff
path: root/examples/35-extend-struct-inline/src
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-12-19 16:30:17 +0000
committerMichael Williamson <mike@zwobble.org>2024-12-19 16:30:17 +0000
commit4f8135071ae6faf7abfbc2f4765101ce9c0bb287 (patch)
tree466ce9540538e5f3a193b0b82fde30796651de0f /examples/35-extend-struct-inline/src
parentcbe45599f7b46d7a0674a62d424b9485e7735d45 (diff)
Define methods directly on struct
Diffstat (limited to 'examples/35-extend-struct-inline/src')
-rw-r--r--examples/35-extend-struct-inline/src/HelloWorld.shed20
1 files changed, 0 insertions, 20 deletions
diff --git a/examples/35-extend-struct-inline/src/HelloWorld.shed b/examples/35-extend-struct-inline/src/HelloWorld.shed
deleted file mode 100644
index bcdcf023..00000000
--- a/examples/35-extend-struct-inline/src/HelloWorld.shed
+++ /dev/null
@@ -1,20 +0,0 @@
-pub fun main() ! Io -> Unit {
- print!(Count(1).message());
- print!(Count(2).message());
- print!(Count(3).message());
-}
-
-struct Count(.value: Int) {
-}
-
-extend Count {
- fun message(this) -> String {
- if (this.value == 1) {
- "one\n"
- } else if (this.value == 2) {
- "two\n"
- } else {
- "many\n"
- }
- }
-}