問題描述:
{badarg,{ets,fun2ms,[function,called,with,real,'fun',should,be,transformed,with,parse_transform,'or',called,with,a,'fun',generated,in,the,shell]}}
問題解決:
Reading from the official documentation:
Pseudo function that by means of a parse_transform translates LiteralFun typed as parameter in the function call to a match_spec. With "literal" is meant that the fun needs to textually be written as the parameter of the function, it cannot be held in a variable which in turn is passed to the function).
意思就是:fun2ms函數必須以文本形式寫成函數的參數,它不能保存在一個變量中,然後傳遞給函數。