[erlang-questions] Problems in a list

Pierpaolo Bernardi olopierpa@REDACTED
Thu Aug 16 13:27:08 CEST 2007


On 8/16/07, Prabhuram K <prabhuram.k@REDACTED> wrote:
> Hello all,
> I am a newbie to erlang.
> I have a value of this format "\"srs1\",\"srs2\"". If I do a list_to_atom on
> this I get '"srs1","srs2"', that is within single quote. So if I store it as
> [SrsNameList] it is stored as ['"srs1","srs2"'].  I don't need the single
> quote, it should just be ["srs1","srs2"]. How do I do that ?

There are no single quotes in the atom name. The single quotes you see are
part of the syntax of atoms.

Look at this:

23> list_to_atom("A").
'A'
24> list_to_atom("a").
a

Note that  atoms once created are never deleted and that only a
limited number of them can be created. So it's not a good idea to
apply list_to_atom to random lists.

P.



More information about the erlang-questions mailing list