login

Availability:built-in
[commons]atomic_list_concat(+List, +Separator, ?Atom)
Creates an atom just like atomic_list_concat/2, but inserts Separator between each pair of atoms. For example:
?- atomic_list_concat([gnu, gnat], ', ', A).

A = 'gnu, gnat'

The SWI-Prolog version of this predicate can also be used to split atoms by instantiating Separator and Atom as shown below. We kept this functionality to simplify porting old SWI-Prolog code where this predicate was called concat_atom/3.

?- atomic_list_concat(L, -, 'gnu-gnat').

L = [gnu, gnat]