~statianzo/sevenlangs

sevenlangs/io/day1_questions.io -rw-r--r-- 357 bytes
2fcd4511Jason Staten day one logic style 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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