• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

4.22 Analysing and Constructing Atoms
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Analysing and Constructing Atoms
          • atom_codes/2
          • atom_chars/2
          • char_code/2
          • number_chars/2
          • number_codes/2
          • atom_number/2
          • name/2
          • term_to_atom/2
          • atom_to_term/3
          • atom_concat/3
          • atomic_concat/3
          • atomic_list_concat/2
          • atomic_list_concat/3
          • atom_length/2
          • atom_prefix/2
          • sub_atom/5
          • sub_atom_icasechk/3
    • Packages
Availability:built-in
name(?Atomic, ?CodeList)
CodeList is a list of character codes representing the same text as Atomic. Each of the arguments may be a variable, but not both. When CodeList describes an integer or floating point number and Atomic is a variable, Atomic will be unified with the numeric value described by CodeList (e.g., name(N, "300"), 400 is N + 100 succeeds). If CodeList is not a representation of a number, Atomic will be unified with the atom with the name given by the character code list. When Atomic is an atom or number, the unquoted print representation of it as a character code list will be unified with CodeList.

Note that it is not possible to produce the atom '300' using name/2, and that name(300, CodeList), name('300', CodeList) succeeds. For these reasons, new code should consider using the ISO predicates atom_codes/2 or number_codes/2.103Unfortunately, the ISO predicates provide no neat way to check that a string can be interpreted as a number. The most sensible way is to use catch/3 to catch the exception from number_codes/2; however, this is both slow and cumbersome. We consider making, e.g., number_codes(N, "abc") fail silently in future versions. See also atom_number/2.

ClioPatria (version V3.1.1-21-gb8003bb)