Thanks for you feedback.
About keeping or discarding changes. Currently I'm leaning towards keeping changes in the returned list, but discarding changes for the other elements.
Here's an example that motivates keeping the changes for the returned list:
If changes are discarded you'd have to do ugly workarounds to not duplicate the logic. But if the changes are kept and you don't want them it's trivial to change the behaviour: just add local $_ = $_;.my @keywords = qw/ foo !bar baz /; my @exclude = extract { s/^!// } @keywords;
The reason I want to discard changes for elements left in the array is that if changes is kept for the returned array then changes are kept for all elements, and then you can usually just as well do those changes to the array before extract.
lodin
In reply to Re^3: RFC: List::Extract
by lodin
in thread RFC: List::Extract
by lodin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |