These predicates convert between Prolog constants and lists of ASCII values. The predicates atom_chars/2, number_chars/2 and name/2 behave the same when converting from a constant to a list of ASCII values. When converting the other way around, atom_chars/2 will generate an atom, number_chars will generate a number or fail and name/2 will return a number if possible and an atom otherwise.
name(N, "300"), 400 is N +
100
' succeeds).
0'
<c>.
Otherwise 2 =<Base =< 36. Some examples are
given below.
int_to_atom(45, 2, A) | --> | A = 2'101101 |
int_to_atom(97, 0, A) | --> | A = 0'a |
int_to_atom(56, 10, A) | --> | A = 56 |
int_to_atom(Int, 10, Atom)
.
?- concat_atom([gnu, gnat], ', ', A). A = 'gnu, gnat' |
?- concat(Prefix, _, Atom)
,
but avoids the construction of an atom for the `remainder'.