Skip Menu |
Report information
Id: 131956
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: elizabeth <liz [at] dijkmat.nl>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Zen/Whatever slice ignore :v
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: rakudobug [...] perl.org
Date: Thu, 24 Aug 2017 11:41:42 +0200
Download (untitled) / with headers
text/plain 197b
$ 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
Download (untitled) / with headers
text/plain 523b
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.)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org