作者:U友60759920 | 来源:互联网 | 2023-06-11 13:25
```erlangA?[{a,0},{b,0},{c,1}].B?[{x,0},{y,0},{z,1}].?C[A|B]%C[[{a,0},{b,0},{c,1}]
```erlang
A =?[{a,0},{b,0},{c,1}].
B =?[{x,0},{y,0},{z,1}].
?
C = [A|B] % C=[[{a,0},{b,0},{c,1}],{x,0},{y,0},{z,1}].
```
因为?[A|B] 的意思是把A作为一个列表元素加入到新的列表中。所以是列表嵌套着列表。
如果是列表相加那么可以这么写:
```erlang
A =?[{a,0},{b,0},{c,1}].
B =?[{x,0},{y,0},{z,1}].
?
D = A ++ B % D=[{a,0},{b,0},{c,1},{x,0},{y,0},{z,1}].
```