sub group (*@array is copy) {
gather {
while @array {
take [ # line 112
gather {
my $h = shift @array;
take $h;
while @array and $h eq @array[0] {
take shift @array;
}
}
];
}
}
}
I added that to my "99 Problems" code because it worked just fine (I
would swear it did. I'd be embarrassed if I am misremembering). Now
I've upgraded Pugs and it fails with:
Unexpected "["
expecting bare or pointy block construct, ":", identifier, operator
or "}"
at 99.pugs line 112, column 18
Line 112 is the first take. Did something break? If so, I'll add a
test. Otherwise, what's wrong with this code? Also, I've been
searching the docs for the exact syntax of 'gather/take' and I can't
find it. Pointers would be great.
Pugs Version: 6.2.13 (r14911)
Cheers,
Ovid
--
Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/
I noticed this as well, and believe it's a bug -- pugs accepts
the code if you remove all the newlines. Then again, I'm not
sure this is the desired behavior:
pugs> group(1..10)
((1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,), (10,))
/s
It looks like there's a bug in gather/take and luqui is working on it
now (from #perl6).