list_to_atom use in kernel/error_logger.erl

Serge Aleynikov serge@REDACTED
Wed Feb 1 07:09:04 CET 2006


I was browsing through the kernel/error_logger.erl and the following 
code caught my attention.  Wouldn't the call list_to_atom/1 eventially 
lead to exhaustion of the atom table?

----kernel/error_logger.erl (line: 288)-------------------
display2(Tag,F,A) ->
     erlang:display({error_logger,Tag, nice(F), nice(A)}).

nice(X) when tuple(X) ->
     nice_tuple(X);

nice([]) -> [];
nice(L) when list(L) ->
     case is_string(L) of
     true ->
         list_to_atom(L);
     false ->
         [H|T] = L,
         [nice(H) | nice(T)]
     end;
nice(X) -> X.
----------------------------------------------------------

Why does a list need to be converted to atom here?

Serge



More information about the erlang-questions mailing list