Erlang Central

List to term

From ErlangCentral Wiki

There is not a list_to_term() function, but it easy to write one yourself.

list_to_term(String) ->
    {ok, T, _} = erl_scan:string(String++"."),
    case erl_parse:parse_term(T) of
        {ok, Term} ->
            Term;
        {error, Error} ->
            Error
    end.