void abs(int y) { if (y >= 0) { r = y; return; } else { r = -y; return; } }
\Why the two ugly return;
statements in a function that needs none?" I almost hear you ask. Here is why: without these spurious return;
statements you may need to explain where the {2; 3; }
set comes from in the screenshot below.
In the screenshot the user has clicked on variable r
in the then branch of the if. The bottom panel displays information about the value of r
before the assignment and also the possible values of r
at the beginning of the successor of the assignment. The intention is to let the user see the effect the statement has on x
but in this case this only produces confusion.
Behold the new graphical user interface that Boris and I have spent the afternoon on (pay attention: the difference is subtle):