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

19 lines
472 B
Text

procedure main()
&trace := -1 # ensures functions print their names
every (i := false | true ) & ( j := false | true) do {
write("i,j := ",image(i),", ",image(j))
write("i & j:")
x := i() & j() # invoke true/false
write("i | j:")
y := i() | j() # invoke true/false
}
end
procedure true() #: succeeds always (returning null)
return
end
procedure false() #: fails always
fail # for clarity but not needed as running into end has the same effect
end