>>>>> On 11 Jan 2001 15:22:30 -0600, Tim Ayers <[EMAIL PROTECTED]> said:

 > John Porter and I have created a new module Algorithm::Intersperse.
 > I wanted some confirmation on our name choice, tho. 

 >   NAME
 >      Algorithm::Intersperse - Intersperse / unsort / disperse a
 >      list

 >   SYNOPSIS
 >        use Algorithm::Intersperse qw/intersperseq/;

 >        @ispersed = intersperseq {substr($_,0,1)} qw/A1 A2 B1 B2 C1 C2/;

 >        @ispersed = Algorithm::Intersperse::intersperse qw/A A B B B B B B C/;


 >   DESCRIPTION
 >      intersperse and intersperseq evenly distribute elements of a
 >      list. Elements that are considered equal are spaced as far
 >      apart from each other as possible.

 >   FUNCTIONS
 >      intersperse LIST
 >          This function returns a list of elements interspersed so
 >          that equivalent items are even distributed throughout
 >          the list.

 >      intersperseq BLOCK LIST
 >          intersperseq works like intersperse but it applies BLOCK
 >          to the elements of LIST to determine the equivalance
 >          key.


 > So /A A B B C C/ comes out like /A B C A B C/. 

 > We thought Algorithm:: because of Algorithm::Numerical::Shuffle and
 > Algorithm::Permute. The other choice was Sort::Intersperse. Any
 > comments or suggestions? Thanks a lot.

I have no problems with Algorithm::Intersperse, but I'd throw in
List::Intersperse as an alternative because it's shorter to type and
apparently only lists are involved in the interspersing function.

Just my "0.02 \x{20a0}"
-- 
andreas

Reply via email to