11.3.17 atom_concat/3 [ISO]

Synopsis

atom_concat(+Atom1,+Atom2,-Atom12)

atom_concat(-Atom1,-Atom2,+Atom12)

The characters of the atom Atom1 concatenated with those of Atom2 are the same as the characters of atom Atom12.

Arguments

Atom1
atom
Atom2
atom
Atom12
atom

Description

Initially, either both Atom1 and Atom2, or Atom12, must be instantiated to atoms. If only Atom12 is instantiated, nondeterminately enumerates all possible atom-pairs that concatenate to the given atom, e.g.:

     | ?- atom_concat(A, B, 'ab').
     
     A = '',
     B = ab ? ;
     
     A = a,
     B = b ? ;
     
     A = ab,
     B = ''  ;
     
     no

Exceptions

instantiation_error
More than one argument uninstantiated.
type_error
An instantiated argument is not an atom.
representation_error
Atom12 is too long to be represented.

See Also

atom_length/2, sub_atom/5.


Send feedback on this subject.