I don't believe this exists, but it should be easy to write by combining ideas 
from Julia's cumsum and foldl. You'd end up with cumfoldl and cumfoldr.

 -- John

On Sep 9, 2014, at 7:29 AM, John Drummond <[email protected]> wrote:

> 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