On Tue, Oct 29, 2002 at 01:05:12PM -0400, Bernie Cosell wrote:
> I'm cobbling up a bit of code that'll need to do something akin to 'map' on two 
> lists at the same time.  I'm going to just brute-force it [doing shifts in a 
> loop:   $left = shift @leftlist; $right = shift @rightlist, with all the usual 
> nonsense around to do the right thing when one list is shorter than the other 
> [delivering up 'undef's but without warnings, etc]....  But it feels clumsy.


>>> a=(1, 2, 3)
>>> b=('a', 'b', 'c')
>>> c = map (None, a, b)
>>> c
[(1, 'a'), (2, 'b'), (3, 'c')]
>>>

Oh, Fun With *Perl*. D'oh :-)

For those that are interested, 
http://www.python.org/doc/current/lib/built-in-funcs.html

Perl 6's map will be able to do this and more.

Paul

-- 
Paul Makepeace ....................................... http://paulm.com/

"What is movement? Unconditional Love and Acceptance."
   -- http://paulm.com/toys/surrealism/

Reply via email to