Gilbert R. Röhrbein ha scritto:
Hi,

I'm new to Perl 6 (and perl).

Is there a way to check inside a gather-block if something was allready taken? I thought it would look like one of the following, but it doesnt work on my pugs 6.2.13.

gather
{
   for 1..100
   {
      take $_ unless @_.contains(42)
   }
}

I think in place of @_ you'd want "gathered" which gives you access to the anonymous array being constructed from gather/take.
But AFAIK this does not work in pugs 6.2.13 :/

Reply via email to