This nearly the same as atom_concat/3 but it doesn't generate substrings from the 3rd argument if asked to do so.
Your choices
Your choice of predicate is as follows:
Two concatenable terms as input (can split)
- atom_concat/3 (ISO)
- string_concat/3
Two more general concatenable terms as input (cannot split because arguments 1 and 2 are too general)
A list of concatenable terms as input (never split)
- atomic_list_concat/2 - generates atom at argument 2. Refuses string at argument 2 in accept mode (that's likely a bug).
- atomics_to_string/2 - generates string at argument 2. Refuses atom at argument 2 in accept mode (that's likely a bug).
A list of concatenable terms as input, and intersperse another string (can split at interspersed string)
- atomic_list_concat/3 - concatenate with separator ("intersperse", "join"). Refuses string at argument 3 in accept mode (that's likely a bug).
- atomics_to_string/3 - concatenate with separator ("intersperse", "join"). Refuses atom at argument 3 in accept mode (that's likely a bug).
Test code
:- begin_tests(atomic_concat). test("atomic_concat/3 generates atom at the 3rd argument") :- atomic_concat(a,b,X), assertion(X==ab). test("atomic_concat/3 in 'accept mode' allows string at 3rd argument") :- atomic_concat(a,b,"ab"). test("atomic_concat/3 accepts string at argument 1 and 2") :- atomic_concat("a",b,X), assertion(X==ab), atomic_concat(a,"b",Y), assertion(Y==ab), atomic_concat("a","b",Z), assertion(Z==ab). test("atomic_concat/3 actually accepts atomic at argument 1 and 2 and even 3") :- atomic_concat(1,2,X), assertion(X=='12'), atomic_concat(1,2,12). test("atomic_concat/3 refuses to generate",error(instantiation_error)) :- atomic_concat(_X,_Y,ab). :- end_tests(atomic_concat).