Re: erlang_taiwan@googlegroups.com 的摘要 - 1 個主題,1 則更新

12 views
Skip to first unread message

Jake Morrison

unread,
May 2, 2015, 1:25:03 AM5/2/15
to erlang...@googlegroups.com
Hi Greg, 

You have probably figured out how to do it by now, but here is a better version: 

Cheers,
Jake

2015-05-02 0:17 GMT+08:00 <erlang...@googlegroups.com>:
Greg Lin <gre...@vucities.com>: Apr 30 09:13PM -0700

各位好,
小弟初學Erlang,一開始就遇到一些問題,但自己卻看不出錯誤在哪,想請有點經驗的人幫小弟看看以下的code問題出在哪裏,感謝!
compile時錯誤碼為:
tut7.erl:8: syntax error before: ';'
tut7.erl:4: function convert_list_to_c/1 undefined
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(tut7).
-export([format_temps/1]).
format_temps(City_list)->
Convert_List = convert_list_to_c(City_list),
print_list(Convert_List).
convert_list_to_c([{Name, {f, F}}| Rest])->
Convert_City=[{Name, {c, (F -32)*5 / 9}},
[Convert_City | convert_list_to_c(Rest)];
convert_list_to_c([City | Rest])->
[City | convert_list_to_c(Rest)];
convert_list_to_c([])->
[].
print_list([{Name, {c, Degree}}| Rest])->
io:format("~-15w ~w c~n", [Name, Degree]),
print_list(Rest);
print_list([])->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%
您已訂閱這個群組的更新通知,因此我們特別傳送這份摘要給您。如要變更訂閱設定,請前往群組成員頁面
如要取消訂閱這個群組並停止接收來自這個群組的郵件,請傳送電子郵件到 erlang_taiwa...@googlegroups.com

Reply all
Reply to author
Forward
0 new messages