atom_chars/2

Synopsis

atom_chars(+Atom, -Chars)

atom_chars(-Atom, +Chars)

Chars is the list of ASCII character codes comprising the printed representation of Atom.

Arguments


Chars chars
the list of ASCII character codes comprising the printed representation of Atom.
Atom atom
will be instantiated to an atom containing exactly those characters, even if the characters look like the printed representation of a number.

Description

Initially, either Atom must be instantiated to an atom, or Chars must be instantiated to a proper list of character codes (containing no variables).

Any atom that can be read or written by Prolog can be constructed or decomposed by atom_chars/2.

Comment

If you deal with chars values often, you may find it useful to load library(printchars). Once this is done, a list of character codes will be written by print/1 as double-quoted text.

Exceptions


instantiation_error

type_error

representation_error

See Also

print/1, library(printchars)