Damian Conway wrote:
In other words, classify() takes a list of values, examines each in turn, and ascribes a "label" value to it. The call returns a list of pairs, where each pair key is one of the label values and each pair value is an array of all the list values that were ascribed that label.


Personally, I don't have a problem with us keeping 'grep'. However, if we do decide to change the name, I suspect 'keep' might be readable, short, SWIM, and not confused with other operations:

    my @evens = keep { $^num % 2 == 0 } @numbers;


OK then. Just so that I can type of the final result in S29, let's see if everyone agrees to several points that have been made in this thread:

1. "classify" is the real grep
2. convenience function, "keep" is probably a macro
3. "use List :compat" will get you a "grep" just as it will likely get you "mv" on the OS module, etc.

Is any of this going to break the bank? If not, I'll get it in today.

Reply via email to