2009-12-24 03:12:07 -05:00
|
|
|
a: b: d: true
|
|
|
|
c: false
|
|
|
|
|
|
|
|
result: if a
|
|
|
|
if b
|
2009-12-28 23:08:02 -05:00
|
|
|
if c then false else
|
2009-12-24 03:12:07 -05:00
|
|
|
if d
|
2009-12-28 23:08:02 -05:00
|
|
|
true
|
2009-12-24 03:12:07 -05:00
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok result
|
2010-01-25 20:52:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
first: if false then false else second: if false then false else true
|
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok first
|
|
|
|
ok second
|
2010-02-13 02:00:39 -05:00
|
|
|
|
|
|
|
|
|
|
|
result: if false
|
|
|
|
false
|
|
|
|
else if NaN
|
|
|
|
false
|
|
|
|
else
|
|
|
|
true
|
|
|
|
|
2010-03-10 16:18:17 -05:00
|
|
|
ok result
|
|
|
|
|
|
|
|
|
|
|
|
# If statement with a comment-only clause.
|
|
|
|
result: if false
|
|
|
|
# comment
|
|
|
|
else
|
|
|
|
27
|
|
|
|
|
|
|
|
ok result is 27
|
2010-04-27 19:35:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Testing unless.
|
|
|
|
result: unless true
|
|
|
|
10
|
|
|
|
else
|
|
|
|
11
|
|
|
|
|
|
|
|
ok result is 11
|
2010-06-12 19:38:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Nested inline if statements.
|
|
|
|
echo: (x) -> x
|
|
|
|
result: if true then echo((if false then 'xxx' else 'y') + 'a')
|
|
|
|
ok result is 'ya'
|