erlang 编译时出现记录错误

Some error occurred concerning record in erlang when compile

我是 erlang 的新手,这是我的代码:

-module(main).
-author("jasonzhu").

%% API
-export([new/2]).

-record(person, {name, age}).



new(Name, Age) ->
  #person(name=Name, age=Age).

通过erl main.erl在提示符下编译时,出现以下错误:

$ erlc main.erl 
main.erl:20: syntax error before: '('
main.erl:13: function new/2 undefined
main.erl:15: Warning: record person is unused

有人能帮帮我吗?我没有看到任何针对我的问题的明确罪魁祸首。

提前致谢。

最后一行应该是大括号,而不是圆括号:

new(Name, Age) -> 
    #person{name=Name, age=Age}.

请参阅 records for more information (and examples)

上的文档