Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split gives incorrect results when splitting a number with the :skip-empty adverb #5654

Closed
p6rt opened this issue Sep 10, 2016 · 4 comments
Closed
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Sep 10, 2016

Migrated from rt.perl.org#129242 (status was 'resolved')

Searchable as RT129242$

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 10, 2016

From @dogbert17

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

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 10, 2016

From @zoffixznet

Thanks for the report.

It appears all of .split's adverbs were broken on Cool, including the .split(@​needles) call form.

Fixed in rakudo/rakudo@b771bcc
Tests added in Raku/roast@060cf7a

On Sat Sep 10 09​:01​:27 2016, jan-olof.hendig@​bredband.net wrote​:

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

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 10, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

@p6rt p6rt commented Sep 10, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this Sep 10, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.