Please migrate this question if it is not appropriate for Math.SE (I fear it is not).
In the following snippet, $f(i,j)$ is a procedure that compares the value of $i$ and $j$ before deciding what to return.
The code
sum(sum(f(i, j), j = 1 .. 5), i = 1 .. 5);
gives the error
Error, (in f) cannot determine if this expression is true or false: i <= j
My understanding is that Maple has not yet assigned a value to either of $i$ and $j$, and so cannot make the comparison. The suggested fix for this is to use unevaluation quotes like so
sum(sum('f'(i, j), j = 1 .. 5), i = 1 .. 5);
but this gives a new error
Error, (in f) cannot determine if this expression is true or false: i <= 1
Apparently the quotes allow it to understand $j$, but not $i$. I've tried various other combinations of unevaluation quotes around f and around sum, but I get similar errors each time. How can I get this code to run?