Question: Simple if/else function won't plot

f := x -> if(x<=0, 0, 1):
#plot(f(x),x=-10..10):
#plot(f,-10..10):
plot(sum(f,i=-infinity..infinity),-10..10);
plot(sum(f(i),i=-infinity..infinity),-10..10);

Why do the first two plots work, but the third and fourth doesn't? How do I plot the sum of this function in a specific range?

Please Wait...