开发者

'zip' in Erlang

I'm just wondering if there is a ready implementation of zip-function in the standart erlang library. Something like that:

zip([H1|T1],开发者_如何学Go [H2|T2], Acc)->
    zip(T1, T2, Acc ++ [{H1, H2}]);
zip([], [], Acc) ->
    Acc.


There is a zip function in the lists module:

> lists:zip([a,b,c], [1,2,3]).
[{a,1},{b,2},{c,3}]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜