On Fri Aug 29 13:14:19 2008, ronaldxs wrote: > > $ < empty ./perl6 -e 'say split("\n", $*IN.slurp)' # but this fails > > Two proposed patches attached. The patch to src/pmc/parrotiio.pmc seems > to fix the problem as originally stated. Then the patch to > languages/perl6/src/classes/Str.pir seems to fix 'say > $*IN.slurp.split("\n")'. If you have any questions please ask. > Thanks for the patches! The first one to ParrotIO, I fully agree with so I have applied it in r30981 (if you slurp an empty file, the empty string would seem a much more sensible and predictable result than a NULL string, which suggests something went wrong with the read). And this fixes the test that was originally submitted for this ticket. :-)
The second patch was not quite correct - we need to have it :multi for when we implement the regex variant. I changed it to: .sub 'split' :method :multi('String') So it's a bit more liberal about what sorts of strings it gets for now. Thanks! Jonathan