11.3.231 =.. /2 [ISO]

Synopsis

+Term =.. -List

-Term =.. +List

Unifies List with a list whose head is the atom corresponding to the principal functor of Term and whose tail is a list of the arguments of Term.

Arguments

Term
term any term
List
list of term and not empty

Description

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 arg/3 and functor/3, and using the latter two is usually more efficient.

Examples

     | ?- product(0, n, n-1) =.. L.
     
     L = [product,0,n,n-1]
     
     | ?- n-1 =.. L.
     
     L = [-,n,1]
     
     | ?- product =.. L.
     
     L = [product]

Exceptions

instantiation_error
Term is instantiated and List has an uninstantiated tail.
type_error
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.
domain_error
List is the empty list.
representation_error
Term is uninstantiated and List is longer than 256.

See Also

functor/3, arg/3, ref-lte-act.


Send feedback on this subject.