RosettaCodeData/Task/Short-circuit-evaluation/Fantom/short-circuit-evaluation.fantom

29 lines
432 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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)
}
}
}
}