我试图在案例中使用“_”,但我错过了一些东西。我正在做的是:
case (Packet =:= #xmlel{name = <<"message">>, attrs = [_, {<<"type">>,<<"chat">>}], children = _}) of
true ->
?INFO_MSG("True ###### Packet ~p", [Packet]);
_ ->
?INFO_MSG("False ###### Packet ~p", [Packet])
end,
错误是:变量'_'未绑定。
我希望这个变量“_”在这个函数中意味着每一件事。
喜欢 -->
attrs = [Whatever, {<<"type">>,<<"chat">>}]
children = Whatever
我该怎么做?谢谢。