【发布时间】:2020-04-08 10:15:51
【问题描述】:
为什么要编译这段代码:
triples( [], _,_,_)->
[];
triples( Self, X, Y, none )->
[ Result || Result = { X, Y, _} <- Self ].
报告:
./simple_graph.erl:63: Warning: variable 'X' is unused
./simple_graph.erl:63: Warning: variable 'Y' is unused
./simple_graph.erl:64: Warning: variable 'X' is unused
./simple_graph.erl:64: Warning: variable 'X' shadowed in generate
./simple_graph.erl:64: Warning: variable 'Y' is unused
./simple_graph.erl:64: Warning: variable 'Y' shadowed in generate
并返回错误的结果:full Self。
【问题讨论】:
标签: erlang