RosettaCodeData/Task/Short-circuit-evaluation/LiveCode/short-circuit-evaluation.li...

24 lines
599 B
Plaintext

function aa bool
global outcome
put "aa called with" && bool & cr after outcome
return bool
end aa
function b bool
global outcome
put "b called with" && bool & cr after outcome
return bool
end b
on mouseUp
global outcome
put empty into outcome
repeat for each item op in "and,or"
repeat for each item x in "true,false"
put merge("[[aa(x)]] [[op]] [[b(x)]]") & cr after outcome
put merge("[[aa(x)]] [[op]] [[b(not x)]]") & cr after outcome
end repeat
put cr after outcome
end repeat
put outcome
end mouseUp