Yukihiro Matsumoto wrote:
> 
> Hi,
> 
> In message "[ruby-talk:12374] Re: Haskell goodies, RCR and challenge"
>     on 01/03/10, Yukihiro Matsumoto <matz / zetabits.com> writes:
> 
> ||        (0..4).to_a.partition {|e| e%2 == 0}  # => [[0,2,4], [1,3]]
> |
> |I like this function.  Although it's mere combination of "select" and
> |"reject".  But I don't prefer the word "partition" for the
> |functionality.
> 
> The method name should be verb, and preferably end with "ct" to rhyme
> with other method names.  e.g. "bisect"?
> 

here's some:
(from http://www.concordance.com/cgi-bin/crossword.pl 
using ?????ct patterns)

dissect 
extract
inflect 
refract 
subsect 
diffract 
distinct
subselect 

non-rhyming:
comb 
allot
split 
assort 
gather
disjoin
polarize 
separate 
subdivide 


There were lots more ending in "ct", but most of them
had nothing to do with the functionality. This one is
tricky because it takes a group of elements and puts
them into two groups based on whether the expression
is true or false - implying a polarizing effect.

I think 'polarize' is probably best, and would imply
it only deals with true/false and two resulting groups.


However, suppose someone wished to use "<=>" and make
three resulting groups? I think that would also be
quite useful :-)  And of course, an arbitrary method
might be desired for creating even more resulting groups.

For this, I would think 'assort' could be used.

Of course, there's always bisect, trisect, and polysect.

OTOH, maybe 'split' can be used to concisely represent all
three at once?


Guy N. Hurst



-- 
HurstLinks Web Development    http://www.hurstlinks.com/
Norfolk, VA  23510            (757)623-9688 FAX 623-0433
PHP/MySQL - Ruby/Perl - HTML/Javascript