Unifies List with a list whose head is the atomic term corresponding to the principal functor of Term and whose tail is a list of the arguments of Term.
term any term
list of term and not empty
If Term is uninstantiated, then List must be instantiated either to a proper list whose head is an atom, or to a list of length 1 whose head is a number.
This predicate is not strictly necessary, since its functionality can
be provided by
functor/3, and using the latter
two is usually more efficient.
| ?- product(0, n, n-1) =.. L. L = [product,0,n,n-1] | ?- n-1 =.. L. L = [-,n,1] | ?- product =.. L. L = [product]
Term is unbound and List is not instantiated enough.
List is not a proper list, or the head of List is not atomic, or the head of List is a number and the tail of List is not empty.
List is the empty list.
Term is uninstantiated and List is longer than 256.