in reply to why each/keys/values can't work on slice?
This ambiguity in interpretation should already explain why it's not implemented.
the technical answer is that each/keys/values operate on variables like hashes (or arrays in newer Perls) and manipulate an internal iterator counter.
But a slice returns a LIST and not a variable, otherwise your intended feature would require implementing separate counters for each slice.
Anyway you can always create a temporary variable on the fly, if you really need to apply each/keys/values ...
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why each/keys/values can't work on slice? (updated)
by Anonymous Monk on Jan 11, 2023 at 03:10 UTC | |
by LanX (Saint) on Jan 11, 2023 at 03:43 UTC | |
by Anonymous Monk on Jan 11, 2023 at 05:24 UTC | |
by LanX (Saint) on Jan 11, 2023 at 05:45 UTC | |
by ikegami (Patriarch) on Jan 11, 2023 at 19:07 UTC |