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

Zen/Whatever slice ignore :v #6465

Closed
p6rt opened this issue Aug 24, 2017 · 4 comments
Closed

Zen/Whatever slice ignore :v #6465

p6rt opened this issue Aug 24, 2017 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Aug 24, 2017

Migrated from rt.perl.org#131956 (status was 'open')

Searchable as RT131956$

@p6rt
Copy link
Author

p6rt commented Aug 24, 2017

From @lizmat

$ 6 'my @​a = ^5; @​a[10]=42; .say for @​a[]​:v'
0
1
2
3
4
(Any)
(Any)
(Any)
(Any)
(Any)
42

Note that :k *does* honour the filtering logic​:

$ 6 'my @​a = ^5; @​a[10]=42; .say for @​a[]​:k'
0
1
2
3
4
10

@p6rt
Copy link
Author

p6rt commented Aug 24, 2017

From @smls

I'm surprised that zen slices accept adverbs at all.

Isn't the whole point of a zen slice to return the invocant object directly, without looking at its elements or constructing a slice from them?

I would probably make it print an error along the lines of​:

  ===SORRY!===
  Adverbs don't make sense on a zen slice.
  To get a slice of all elements, use the Whatever-star​: %foo[*]​:v
  ------> say %foo[]⏏​:v

(As the title of the ticket says, Whatever-slices *also* ignore :v, so that should be fixed of course.)

@p6rt
Copy link
Author

p6rt commented Aug 24, 2017

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

@JJ
Copy link

JJ commented Dec 30, 2020

:v does too now:

> raku -e  'my @a = ^5; @a[10]=42; .say for @a[]:v'
0
1
2
3
4
42

@JJ JJ closed this as completed Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants