RosettaCodeData/Task/Short-circuit-evaluation/Sather/short-circuit-evaluation.sa
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07: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;