reduce(f, v)={ my(t=v[1]); for(i=2,#v,t=f(t,v[i])); t }; reduce((a,b)->a+b, [1,2,3,4,5,6,7,8,9,10])