RosettaCodeData/Task/Short-circuit-evaluation/Sather/short-circuit-evaluation.sa
2023-07-01 13:44:08 -04:00

26 lines
462 B
Text

class MAIN is
a(v:BOOL):BOOL is
#OUT + "executing a\n";
return v;
end;
b(v:BOOL):BOOL is
#OUT + "executing b\n";
return v;
end;
main is
x:BOOL;
x := a(false) and b(true);
#OUT + "F and T = " + x + "\n\n";
x := a(true) or b(true);
#OUT + "T or T = " + x + "\n\n";
x := a(true) and b(false);
#OUT + "T and T = " + x + "\n\n";
x := a(false) or b(true);
#OUT + "F or T = " + x + "\n\n";
end;
end;