[erlang-questions] Mapping over 2+ lists/variables?

Circular Function <>
Wed Jul 23 18:24:59 CEST 2008


in python I can do:
>>> map(lambda x,y:x+y,[1,2,3],[4,5,6])
[5, 7, 9]
>>> 

38> lists:map(fun(X,Y) -> X+Y end,[1,2],[3,4]).
** exception error: undefined function lists:map/3
39> 

isnt there general map-function that map is derived from that I can use? 
what about listcomprehensions?
44> [X+Y || X,Y <- lists:seq(1,10),lists:seq(1,10)].
* 1: variable 'X' is unbound
45> 


      __________________________________________________________
Låna pengar utan säkerhet. Jämför vilkor online hos Kelkoo.
http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080723/cfe3b5a2/attachment.html>


More information about the erlang-questions mailing list