Mentions légales du service

Skip to content

partial lazy evaluation (conjunctions, disjunctions)

Created by: witwicki

This is not a critical issue, but rather something aseba is lacking that I seem to take for granted when coding in other high-level languages...

In evaluating a conjuction of logical expressions, aseba evaluates all expressions even if the first one is false.

Example:

var a[3]
var i = 0
while (i<3 and a[i]==0) do
   i = i + 1
end

I would expect this loop to terminate with i set to 3, but instead it dies because "a[i]==0" still gets evaluated even after i<3 becomes false.

Of course, there are simple workarounds. But this was still a nuisance when I encountered it because I did not expect aseba to behave as such.