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