Skip Menu |
Report information
Id: 129242
Status: resolved
Priority: 0/
Queue: perl6

Owner: cpan [at] zoffix.com
Requestors: jan-olof.hendig [at] bredband.net
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Sat, 10 Sep 2016 18:01:05 +0200
To: <rakudobug [...] perl.org>
From: "Jan-Olof Hendig" <jan-olof.hendig [...] bredband.net>
Subject: [BUG] split gives incorrect results when splitting a number with the :skip-empty adverb
Download (untitled) / with headers
text/plain 686b
Tested with: dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -v This is Rakudo version 2016.08.1-151-g20ed9e2 built on MoarVM version 2016.08-43-g3d04391 implementing Perl 6.c. # the problem dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -e 'dd 123456.split("", :skip-empty)' ("", "1", "2", "3", "4", "5", "6", "") # as can be seen the result contains two empty strings # compare with dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -e 'dd "123456".split("", :skip-empty)' ("1", "2", "3", "4", "5", "6") # some discussion on irc, contains results from bisectable, commitable etc http://irclog.perlgeek.de/perl6/2016-09-10#i_13184978 /dogbert17
RT-Send-CC: perl6-compiler [...] perl.org
Thanks for the report. It appears all of .split's adverbs were broken on Cool, including the .split(@needles) call form. Fixed in https://github.com/rakudo/rakudo/commit/b771bcc97a Tests added in https://github.com/perl6/roast/commit/060cf7abff On Sat Sep 10 09:01:27 2016, jan-olof.hendig@bredband.net wrote: Show quoted text
> Tested with: > > dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -v > This is Rakudo version 2016.08.1-151-g20ed9e2 built on MoarVM version > 2016.08-43-g3d04391 > implementing Perl 6.c. > > # the problem > > dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -e 'dd > 123456.split("", :skip-empty)' > ("", "1", "2", "3", "4", "5", "6", "") > > # as can be seen the result contains two empty strings > # compare with > > dogbert@dogbert-VirtualBox ~/.rakudobrew/moar-nom $ perl6 -e 'dd > "123456".split("", :skip-empty)' > ("1", "2", "3", "4", "5", "6") > > > > # some discussion on irc, contains results from bisectable, commitable etc > > http://irclog.perlgeek.de/perl6/2016-09-10#i_13184978 > > /dogbert17 >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org