2 Example


Listing 1:short_circuit_1
 
1i
2while (i<|a|)(a[i]kdo 
3  ii+1 
4end while

Let us consider the first example as illustrated in 1. In this example, a is an array, k is an integer, and i is a local variable. The code searches for the value of k in the array a. This code does work, but only when short circuited boolean evaluation is supported. Otherwise, this code is incorrect!

 2.1 Commutable or not?
 2.2 Back to the example