What's the idiomatic way of writing Mathematica's Foldlist in Julia?
i.e. a fold that gives the intermediate results?

e.g. in Mathematica
Fold[Plus, 1, Rest[Range[10]]] 
gives
55
and 
FoldList[Plus, 1, Rest[Range[10]]]
gives
{1, 3, 6, 10, 15, 21, 28, 36, 45, 55}


in Julia
 foldl(+,1,2:10)
gives
55

what's the idiomatic way of giving the intermediate results in an array?
Thanks

kind Regards, John.




Reply via email to