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

Ghost elements in array #6219

Closed
p6rt opened this issue May 2, 2017 · 5 comments
Closed

Ghost elements in array #6219

p6rt opened this issue May 2, 2017 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 2, 2017

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

Searchable as RT131245$

@p6rt
Copy link
Author

p6rt commented May 2, 2017

From shreyasls@yahoo.com

# create an array of 5 elements, remove 2, add a fifth one leaving 4th empty

$ perl -e 'my @​a=(1,2,3,4,5); pop(@​a); pop(@​a); $a[4]="hi"; print join(",", @​a)."\n";'

1,2,3,,hi

$ perl6 -e 'my @​a=(1,2,3,4,5); @​a.pop; @​a.pop, @​a[4]="hi"; say @​a.join(",");'

1,2,3,4,hi

Ouch!

 

$ perl6 -v

This is Rakudo version 2017.04.3-160-g08a8075 built on MoarVM version 2017.04-44-gf0db882

implementing Perl 6.c.

Sent from Yahoo Mail on Android

@p6rt
Copy link
Author

p6rt commented May 3, 2017

From @AlexDaniel

This is probably my favorite bug of the year :)

Thank you very much for your report.

There was a discussion about it today​: https://irclog.perlgeek.de/perl6-dev/2017-05-03#i_14521988

On 2017-05-02 10​:42​:33, shreyasls@​yahoo.com wrote​:

# create an array of 5 elements, remove 2, add a fifth one leaving 4th
empty

$ perl -e 'my @​a=(1,2,3,4,5); pop(@​a); pop(@​a); $a[4]="hi"; print
join(",", @​a)."\n";'

1,2,3,,hi

$ perl6 -e 'my @​a=(1,2,3,4,5); @​a.pop; @​a.pop, @​a[4]="hi"; say
@​a.join(",");'

1,2,3,4,hi

Ouch!

$ perl6 -v

This is Rakudo version 2017.04.3-160-g08a8075 built on MoarVM version
2017.04-44-gf0db882

implementing Perl 6.c.

Sent from Yahoo Mail on Android

@p6rt
Copy link
Author

p6rt commented May 3, 2017

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

@p6rt
Copy link
Author

p6rt commented May 3, 2017

From @zoffixznet

On Tue, 02 May 2017 10​:42​:33 -0700, shreyasls@​yahoo.com wrote​:

# create an array of 5 elements, remove 2, add a fifth one leaving 4th
empty

$ perl -e 'my @​a=(1,2,3,4,5); pop(@​a); pop(@​a); $a[4]="hi"; print
join(",", @​a)."\n";'

1,2,3,,hi

$ perl6 -e 'my @​a=(1,2,3,4,5); @​a.pop; @​a.pop, @​a[4]="hi"; say
@​a.join(",");'

1,2,3,4,hi

Ouch!

$ perl6 -v

This is Rakudo version 2017.04.3-160-g08a8075 built on MoarVM version
2017.04-44-gf0db882

implementing Perl 6.c.

Sent from Yahoo Mail on Android

Thank you for the report. This is now fixed.

Fix​:
  Raku/nqp@7f71ec87e8d2a0
  MoarVM/MoarVM@8ad18b8460
  rakudo/rakudo@c776c0879e

Tests​:
  Raku/roast@2973f845c8

@p6rt
Copy link
Author

p6rt commented May 3, 2017

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

@p6rt p6rt closed this as completed May 3, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
@Raku Raku deleted a comment Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant