[erlang-questions] Introspecting the atom table

Kostis Sagonas kostis@REDACTED
Thu Dec 28 18:34:08 CET 2006


Eric Merritt wrote:
> Kostis,
> 
> Any specific caveats that I should be aware of?

The only reservation that I have about this, is that you better have a 
DAMN good reason to use it.

Most -- though not all -- users that think they need the 
list_to_existing_atom/1 built-in, typically do not really need it.
Often there is a much better/cleaner way to structure the
application that does not use list_to_existing_atom/1.

Hence my comment below.

Kostis

>> Handle with care:
>>
>>
>> Eshell V5.5.2.1  (abort with ^G)
>> 1> list_to_existing_atom("erlang").
>> erlang
>> 2> list_to_existing_atom("gazonk").
>>
>> =ERROR REPORT==== 20-Dec-2006::23:06:58 ===
>> Error in process <0.29.0> with exit value:
>> {badarg,[{erlang,list_to_existing_atom,["gazonk"]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]} 
>>
>>
>> ** exited: {badarg,[{erlang,list_to_existing_atom,["gazonk"]},
>>                      {erl_eval,do_apply,5},
>>                      {shell,exprs,6},
>>                      {shell,eval_loop,3}]} **



More information about the erlang-questions mailing list