summaryrefslogtreecommitdiff
path: root/lib/stdlib/test/shell_docs_SUITE_data/unknown_erlang_list_to_existing_atom_1_func.txt
blob: 315d160be9beef01e65cb8083338778936c003d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

  -spec list_to_existing_atom(String) -> atom() when String :: string().

  Returns the atom whose text representation is String, but only
  if there already exists such atom. An atom exists if it has been
  created by the run-time system by either loading code or creating
  a term in which the atom is part.

  Failure: badarg if there does not already exist an atom whose
  text representation is String.

  Note:
    Note that the compiler may optimize away atoms. For example,
    the compiler will rewrite atom_to_list(some_atom) to 
    "some_atom". If that expression is the only mention of the
    atom some_atom in the containing module, the atom will not
    be created when the module is loaded, and a subsequent call to 
    list_to_existing_atom("some_atom") will fail.