On Thu, Jul 22, 2010 at 11:41 AM, Moritz Lenz <mor...@faui2k3.org> wrote:

>
> The difficulty you're running into is that you're trying to use the wrong
> tool for the job. Just don't use the series operator when it's not easy to
> use. Perl 6 has other mechanism too, which are better suited for these
> particular problems.
>

In general, I'd agree. However, there is something to be said for the
underlying question: is there a way to get at the iteration index from the
lambda in a series? It seems like that's something that it's not
unreasonable to want.

I also think it's doable without a special tool:

  0, { state $i = 1; $^a + $i++ } ... *

That should work, no? Granted, state doesn't seem to work in Rakudo, unless
I'm mis-understanding how to use it, but that's the idea.

-- 
Aaron Sherman
Email or GTalk: a...@ajs.com
http://www.ajs.com/~ajs

Reply via email to