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

Slicing a range no longer produces Nils like it should ( (2..1)[^10] ) #5944

Closed
p6rt opened this issue Dec 30, 2016 · 4 comments
Closed

Slicing a range no longer produces Nils like it should ( (2..1)[^10] ) #5944

p6rt opened this issue Dec 30, 2016 · 4 comments
Labels
regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Dec 30, 2016

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

Searchable as RT130449$

@p6rt
Copy link
Author

p6rt commented Dec 30, 2016

From @AlexDaniel

Code​:
say (2..1)[^10]

Result (2015.12,2016.02)​:
(Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil)

Result (2016.03,HEAD)​:
Index out of range. Is​: 0, should be in 0..-1
  in block <unit> at /tmp/1dJcD1E1Wz line 1

Actually thrown at​:
in block <unit> at /tmp/1dJcD1E1Wz line 1

Bisectable points to rakudo/rakudo@7cbf2d3

It seems that most things produce Nils in similar cases, so the previous behavior was correct. For example, (2,3,4)[^5] will give (2 3 4 Nil Nil), I don't see any reason for ranges to behave differently (especially to error out with an error message like this…)

@p6rt
Copy link
Author

p6rt commented Jan 1, 2017

From @zoffixznet

On Thu, 29 Dec 2016 17​:40​:46 -0800, alex.jakimenko@​gmail.com wrote​:

Code​:
say (2..1)[^10]

Result (2015.12,2016.02)​:
(Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil)

Result (2016.03,HEAD)​:
Index out of range. Is​: 0, should be in 0..-1
in block <unit> at /tmp/1dJcD1E1Wz line 1

Actually thrown at​:
in block <unit> at /tmp/1dJcD1E1Wz line 1

Bisectable points to
rakudo/rakudo@7cbf2d3

It seems that most things produce Nils in similar cases, so the
previous behavior was correct. For example, (2,3,4)[^5] will give (2 3
4 Nil Nil), I don't see any reason for ranges to behave differently
(especially to error out with an error message like this…)

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@c5e54efc88
Tests​: Raku/roast@88106f42b3

@p6rt
Copy link
Author

p6rt commented Jan 1, 2017

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

@p6rt
Copy link
Author

p6rt commented Jan 1, 2017

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

@p6rt p6rt closed this as completed Jan 1, 2017
@p6rt p6rt added the regression Issue did not exist previously label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant