From e7f68a46478e6896546a50813927a9f891dab0ad Mon Sep 17 00:00:00 2001 From: "Callum R. Renwick" Date: Wed, 26 May 2021 16:50:59 +0100 Subject: [PATCH] Fix compile error & add extra comment --- type_aliases/main.pony | 9 ++++++--- type_expressions/main.pony | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/type_aliases/main.pony b/type_aliases/main.pony index d6e8149..c68970a 100644 --- a/type_aliases/main.pony +++ b/type_aliases/main.pony @@ -10,9 +10,12 @@ primitive ColourList fun apply(): Array[Colour] => [Red; Green; Blue] -for colour in ColourList().values() do - -end +actor Main + new create(env: Env) => + for colour in ColourList().values() do + env.out.print("I should be printing a colour + but I don't know how to cast to string") + end // Type aliases can also be used to give simpler names to complex types interface HasName diff --git a/type_expressions/main.pony b/type_expressions/main.pony index cb6b696..cff501f 100644 --- a/type_expressions/main.pony +++ b/type_expressions/main.pony @@ -8,6 +8,7 @@ x = ("hi", 3) x = ("bye", 7) // Pony supports tuple unpacking but calls it "destructuring" +// This assigns "bye" to y and 7 to z (var y, var z) = x // You can access the elements of tuples directly using this