[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Iternating over multiple lists



On 18 May 2000, at 16:47, David L. Nicol wrote:

> Adam Sampson wrote:
> > 
> > On Wed, Apr 12, 2000 at 05:54:19AM +0000, John Carter wrote:
> > > > What perl needed to make the solution to this problem trivial (and
> > > > elegant) is "multiple map" (or, if you rather "parallel map").  That
> > > > is, imagine if you could do:
> > > >
> > > >    mmap {BLOCK} list1 list2 list3 list4 
> 
> I'm missing something.  What is this supposed to return
> that 
> 
> map {BLOCK} (list1, list2, list3, list4)

If the structure is 
   parallelmap {BLOCK}, \l1, \l2, \l3, ... \ln)

then BLOCK would be evaluated with (say) @_ set to:
   (l1[0], l2[0], l3[0], ..., ln[0])
and then it'd be evaluated with
   (l1[1], l2[1], ... ln[1])
and so on... stepping through ALL of the supplied lists simultaneous and 
in parallel...

   /Bernie\

-- 
Bernie Cosell                     Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com     Pearisburg, VA
    -->  Too many people, too few sheep  <--          

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe