
type_of(?Term, -Type)

   Succeeds if Type is the data type of the term Term.



Arguments
   Term                Prolog term.
   Type                Atom or variable.

Type
   Type Testing

Description
   The type of the term Term is unified with Type.


   The types are atoms from the set: string, atom, var, integer, rational,
   float, breal, compound, handle, goal.




Modes and Determinism
   type_of(?, -) is det

Exceptions
     5 --- Type is instantiated, but not to an atom.

Examples
   
Success:
      type_of(X,T).         (gives T=var).
      type_of([1,2],T).     (gives T=compound).
      type_of([],atom).
      type_of(#,atom).
      type_of($,atom).
      type_of(*,atom).
      type_of(/,atom).
      type_of(\,atom).
      type_of("a",string).
      type_of(1,integer).
      type_of(123456789012345,integer).
      type_of(1_3,rational).
      type_of(1.0,float).
      type_of(0.99__1.01,breal).
      type_of(a(b),compound).
      bag_create(B), type_of(B, handle).
      record(k, a), recorded(k, _, R), type_of(R, handle).
      make_suspension(true,3,S), type_of(S, goal).
Fail:
      type_of(2.0,integer).
      type_of(2.0,float).
Error:
      type_of(2,"atom").  (Error 5).





See Also
   atom / 1, callable / 1, compound / 1, free / 1, integer / 1, meta / 1, number / 1, nonground / 1, breal / 1, rational / 1, float / 1, float / 1, real / 1, string / 1, var / 1
