开发者

'zip' in Erlang

开发者 https://www.devze.com 2022-12-13 19:02 出处:网络
I\'m just wondering if there is a ready implementation of zip-function in the standart erlang library.Something like that:

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

精彩评论

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