On Sunday, October 2, 2016 at 6:02:13 AM UTC-4, harven wrote: > > I see that julia v0.5 has now generators. That looks promising but the > example given in the docs is not really interesting, > > sum(1/n^2 for n = 1:1000) > > since we have been able to write from start the shorter and I think as > efficient > > sum(n->1/n^2, 1:1000) > > My question is, where may/should I use generators? >
Generator expressions produce an iterator, so they work with any function that accepts iterables.