[ Term Manipulation | Reference Manual | Alphabetic Index ]

array_concat(+Front, +Back, -Concat)

Concatenate two arrays into one
Front
Array, i.e. structure with functor []/M
Back
Array, i.e. structure with functor []/N
Concat
Variable or array with functor []/(M+N)

Description

Succeeds if Concat is the concatenation of arrays Front and Back.

Modes and Determinism

Exceptions

(4) instantiation fault
Front or Back is a variable (non-coroutining mode only)
(5) type error
Front, Back or Concat are neither variables nor arrays

Examples

?- array_concat([](a,b,c), [](d,e), L).
L = [](a,b,c,d,e)

?- array_concat([](a,b,c), [], L).
L = [](a,b,c)

?- array_concat([], [](d,e), L).
L = [](d,e)

?- array_concat([], [], L).
L = []

?- array_concat([]([](a,b),[](c)), [](d,[](e)), L).
L = []([](a,b), [](c), d, [](e))

See Also

dim / 2, subscript / 3, array_list / 2, is_array / 1, array_flat / 3, arg / 3