From 43c291729cf32a9e937b6d26cf771414cdf74698 Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Thu, 10 Oct 2019 21:25:47 -0600 Subject: [PATCH] answer day 1 questions --- io/day1_questions.io | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 io/day1_questions.io diff --git a/io/day1_questions.io b/io/day1_questions.io new file mode 100644 index 0000000..27d7b0b --- /dev/null +++ b/io/day1_questions.io @@ -0,0 +1,16 @@ +"Is io strongly typed? " print + +try( + 1 + "one" + "no" println +) catch ( + "yes" println +) + +isTruthy := method(x, if(x, true, false)) + +"Is 0 truthy or falsy? #{isTruthy(0)}" interpolate println +"Is nil truthy or falsy? #{isTruthy(nil)}" interpolate println + +# Triple quote to avoid escaping +"""Is "" truthy or falsy? #{isTruthy("")}""" interpolate println