[erlang-questions] a surprising atom

Ulf Wiger ulf@REDACTED
Wed Oct 22 20:08:12 CEST 2008


Well, since [] (or "") is a valid string, and list_to_atom/1
will convert a valid string to a valid atom*, it's perfectly
logical that there should be an "empty atom" as well.

* There is a system limit on how many characters can
be used in an atom, so list_to_atom/1 in fact *wont*
work on strings of length > 255. But "" is even a pretty
common string, so it would be more frustrating if
list_to_atom([]) didn't work.

BR,
Ulf W


2008/10/22 Anthony Shipman <als@REDACTED>:
> Eshell V5.6.4  (abort with ^G)
> 1> X = ''.
> ''
> 2> is_atom(X).
> true
>
> --
> Anthony Shipman                    Mamas don't let your babies
> als@REDACTED                   grow up to be outsourced.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list