首先给大家展示一段错误代码
1 -module(tut2).
2 -export([convert/2]).
3 convert(M,inch)->
4 M/2.54.
5 convert(N,centimeter)->
6 N*2.54.
请注意行4 最后是句点 行6最后也是句点
就会出现开头的错误
解决就是把行4最后标点改成;
1 -module(tut2).
2 -export([convert/2]).
3 convert(M,inch)->
4 M/2.54;
5 convert(N,centimeter)->
6 N*2.54.