Thanks for the answers, the examples are enlightening. I thought at first
that a generator could be used whenever an array was expected, I get it now.
There's nothing you can do with comprehensions or generators that you can't
do with for loops or functional programming. But there are situations where
they are considerably more convenient syntactically. Consider a case where
you have several nested for clauses and a filter clause involving all of
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