>
> But that calls `f()` on every loop of your comprehension, so it's probably
> best to do something like:
>
> g = f()
>
> In  [13]: [g[i] for i=1:2, j=1:3]
>
> Out [13]: 2x3 Array{Any,2}:
>  3.0  3.0  3.0
>  5.0  5.0  5.0
>

Ah ... I should have said, actually, I don't want a constant value.  I
wanted f() called 3 times, and its output arranged into a 3x2 matrix.

[f()[i] for i=1:2, j=1:3]  is clever, but it calls f() 6 times.

Brendan

Reply via email to