The following code fragment from Programming Pearls:
for i = [0, n)
if comlen(a[i], a[i+1]) > maxlen
maxlen = comlen(a[i], a[i+1])
maxi = i
I am not sure why he called the comlen function twice? Instead he could save the computed value in a temporary and use it to assign to maxlen. Isn't the function being called unnecessarily for the second time?