Using lambda expressions
We can rewrite our call to for as
for(0, fn x=>x+1, fn n=>n,
fn (x, y)=>x+y, 0)
We can do better, because
Instead of fn (x, y)=>x+y, we can write op+
We can write an auxiliary function for comparison
Previous slide
Next slide
Back to first slide
View graphic version