匹配错误

当我们调用一个传入错误参数的内建函数时,参数不匹配的函数时,匹配错误就会产生。

当遇到匹配错误时,系统的行为可以描述成以下几种情形:

  1. if(called a BIF with bad args)then
  2. Error = badarg
  3. elseif(cannot and a matching function)then
  4. Error = badmatch
  5. elseif(no matching case statement)then
  6. Error = case_clause
  7. ...
  8. if(within the scope of a catch”)then
  9. Value of catch = {'EXIT', Error}
  10. else
  11. broadcast(Error)
  12. die
  13. endif

其中“broadcast(Error)”可以描述为:

  1. if(Process has Links)then
  2. send {'EXIT', self(), Reason} signals to all linked
  3. processes
  4. endif