RosettaCodeData/Task/Short-circuit-evaluation/Fantom/short-circuit-evaluation.fantom
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

28 lines
432 B
Text

class Main
{
static Bool a (Bool value)
{
echo ("in a")
return value
}
static Bool b (Bool value)
{
echo ("in b")
return value
}
public static Void main ()
{
[false,true].each |i|
{
[false,true].each |j|
{
Bool result := a(i) && b(j)
echo ("a($i) && b($j): " + result)
result = a(i) || b(j)
echo ("a($i) || b($j): " + result)
}
}
}
}