CTM: Exercise 3-5
Posted by Urban Hafner
The problem
An iterative SumList. Rewrite the function SumList of section 3.4.2 to be iterative using the techniques developed for Length.
My solution
local
fun {IterSumList S Es}
case Es
of nil then S
[] E|Er then {IterSumList S+E Er}
end
end
in
fun {SumList L}
{IterSumList 0 L}
end
end
