Contents
1
2
3
4
5
6
7
8
9
10
11
12
输入数组:[k1,v1,k2,v2,k3,v3....]
输出数组:[[k1,v1],[k2,v2],[k3,v3]...]

process_list(2, List, Result)->
[k,v] = List,
[[k,v]|Result];
process_list(_Length, List, Result)->
{[k,v], T} = lists:split(2, List),
process_list(length(T), T, [[k,v]|Result]).

A = [1,2,3,4,5,6],
B = process_list(length(A), A, []).
Contents