On Thursday, December 5, 2002, at 07:55  PM, Damian Conway wrote:
equally. The built-in would actually be doing classification of the
elements of the list, so it ought to be called C<classify>.
I worry that C<classify> sounds too much like something class-related, and would confuse people. What about C<arrange> or something? Decent thesaurus entries for <separate> include:

assign, classify, comb, compartmentalize, discriminate, distribute, group, order, segregate, sift, winnow, amputate, cut, dismember, excise, lop, disunite, divorce, estrange, part, wean, detach, disconnect, disengage, dissociate, extract, isolate, part, steal, take, uncouple, withdraw

Some of those might be appropriate (or just amusing). :-)


The selector block/closure would, naturally, be called in C<int>
context each time, so (again, as Larry pointed out) a boolean
function would naturally classify into two arrays. Though it
How would you do something like:

(@foo,@bar,@zap) := classify { /foo/ ;; /bar/ ;; /zap/ } @source;

I was more hoping for a C<for> or C<given> derivative that would provide a series of 'stream'-like tests, not just one test with N answers. Something that was a shorthand for the obvious but somewhat tedious C<given> counterpart. (If @source had an entry 'foobar', we could debate whether that should go in one destination stream or two.)


Especially since you then get your purge/vrep/antigrep for free:
I don't think we need a separate func either, but if we're gonna have a purge/vrep/antigrep, can someone _please_ think of a better name for it? "purge" clearly needs an inverse called "binge", "vrep" sounds like, well, UNIX, and "antigrep" sounds like something I put in my car to avoid it grepping when I start it on cold mornings.

Even just "ngrep" sounds better to me. :-|

MikeL



Reply via email to