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

Nested slices do not work when adverbs are present #6233

Open
p6rt opened this issue May 9, 2017 · 1 comment
Open

Nested slices do not work when adverbs are present #6233

p6rt opened this issue May 9, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented May 9, 2017

Migrated from rt.perl.org#131280 (status was 'new')

Searchable as RT131280$

@p6rt
Copy link
Author

p6rt commented May 9, 2017

From @zoffixznet

You can give a nested slice as a list and get the result similarly nested, however, this fails when you add any(?) adverbs and you only get results for top-level indexes​:

  m​: dd ("a".."z")[(3, (4, (5,)))]
  rakudo-moar 6bb1b5​: OUTPUT​: «("d", ("e", ("f",)))␤»
  m​: dd ("a".."z")[(3, (4, (5,)))]​:p
  rakudo-moar 6bb1b5​: OUTPUT​: «(3 => "d",)␤»
  m​: dd ("a".."z")[(3, (4, (5,)))]​:k
  rakudo-moar 6bb1b5​: OUTPUT​: «(3,)␤»
  m​: dd ("a".."z")[(3, (4, (5,)))]​:kv
  rakudo-moar 6bb1b5​: OUTPUT​: «(3, "d")␤»

  m​: dd ("a".."z").Hash{('a', ('m', ('s')))}
  rakudo-moar 6bb1b5​: OUTPUT​: «("b", "n", "t")␤»
  m​: dd ("a".."z").Hash{('a', ('m', ('s')))}​:p
  rakudo-moar 6bb1b5​: OUTPUT​: «(​:a("b"),)␤»
  m​: dd ("a".."z").Hash{('a', ('m', ('s')))}​:v
  rakudo-moar 6bb1b5​: OUTPUT​: «("b",)␤»

  m​: dd ("a".."z").Hash{('a', ('m', ('s')), 'u')}​:p
  rakudo-moar 6bb1b5​: OUTPUT​: «(​:a("b"), :u("v"))␤»

@p6rt p6rt added the Bug label Jan 5, 2020
dogbert17 pushed a commit to dogbert17/roast that referenced this issue Dec 28, 2020
dogbert17 pushed a commit to dogbert17/roast that referenced this issue Dec 29, 2020
It turns out that nested array slices were broken, i.e. using them
returned the wrong results.
This was reported in Raku/old-issue-tracker#6233
During lizmat++ work to improve array slices it also turned out
that there were no tests in roast for the above reported issue.
This PR rectifies this omission.
Kaiepi pushed a commit to Kaiepi/roast that referenced this issue Apr 4, 2021
It turns out that nested array slices were broken, i.e. using them
returned the wrong results.
This was reported in Raku/old-issue-tracker#6233
During lizmat++ work to improve array slices it also turned out
that there were no tests in roast for the above reported issue.
This PR rectifies this omission.
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