On Wed, Dec 24, 2008 at 06:38:18PM -0800, Larry Wall wrote:
> On Wed, Dec 24, 2008 at 06:57:39PM -0500, Mark J. Reed wrote:
> : Ok, it works with a $^var in place of $x in the where block.Should
> : the parameter be visible there under its declared name? If not, then
> : this is clearly just p
On Thu, Dec 25, 2008 at 12:53:06AM -0500, Mark J. Reed wrote:
> I also tried this, but it caused Rakudo to throw a StopIteration and
> then segfault:
>
> for [...@gifts[0..$day-1]].pairs.reverse -> $n, $g
The StopIteration occurs when there aren't enough elements in the
list to supply to the para
On Thu, Dec 25, 2008 at 12:00 PM, Patrick R. Michaud wrote:
> On Thu, Dec 25, 2008 at 12:53:06AM -0500, Mark J. Reed wrote:
>> I also tried this, but it caused Rakudo to throw a StopIteration and
>> then segfault:
>>
>> for [...@gifts[0..$day-1]].pairs.reverse -> $n, $g
>
> The StopIteration occur
On Thu, Dec 25, 2008 at 12:39:24PM -0500, Mark J. Reed wrote:
> On Thu, Dec 25, 2008 at 12:00 PM, Patrick R. Michaud
> wrote:
> > On Thu, Dec 25, 2008 at 12:53:06AM -0500, Mark J. Reed wrote:
> >> I also tried this, but it caused Rakudo to throw a StopIteration and
> >> then segfault:
> >>
> >> f
Yeah, I tried a couple zip-based variants, but thought the flattening
was a little confusing when combined with the reversal (so keys and
values get swapped when the list is reversed). I'd forgotten about
the ^max shorthand, though. Thanks for the reminder.
So how to loop over a list of sublist
On Thu, Dec 25, 2008 at 9:39 AM, Mark J. Reed wrote:
> On Thu, Dec 25, 2008 at 12:00 PM, Patrick R. Michaud
> wrote:
>> On Thu, Dec 25, 2008 at 12:53:06AM -0500, Mark J. Reed wrote:
>>> I also tried this, but it caused Rakudo to throw a StopIteration and
>>> then segfault:
>>>
>>> for [...@gifts
On Thu, Dec 25, 2008 at 01:38:54PM -0500, Mark J. Reed wrote:
> Yeah, I tried a couple zip-based variants, but thought the flattening
> was a little confusing when combined with the reversal (so keys and
> values get swapped when the list is reversed). I'd forgotten about
> the ^max shorthand, th
On Thu, Dec 25, 2008 at 12:49:03PM -0600, Patrick R. Michaud wrote:
> There's always:
>
> for @gifts[$^day].pairs.reverse { my ($n,$g) = .kv; ... }
Typo (reversed order of $ and ^ in ^$day):
for @gifts[^$day].pairs.reverse { my ($n,$g) = .kv; ... }
Pm