
get_var_info(?Var, ?InfoName, ?Value)

   Succeeds if Var is an uninstantiated variable, InfoName is a valid
information name and the information value Value unifies with the value of
the information.



Arguments
   ?Var                Prolog Term, usually a variable.
   ?InfoName           Atom or variable.
   ?Value              Atom or variable.

Type
   Type Testing

Description
   This predicate is used to test the type of a free variable or to get its
   source name (when available).


   The possible values for InfoName are type or name.


   If InfoName unifies with name, the predicate will succeed if the source
   name of the free variable Var is available and unifies with Value.


   If InfoName unifies with type, the predicate will succeed if Value
   unifies with the type of the variable Var.


   The possible types are:



    meta      a metaterm
    free      a free variable



Resatisfiable
      Yes.

Fail Conditions
      Fails if Var is not a variable, or if InfoName and Value do not unify
   with a valid information name and its value.



Exceptions
     5 --- InfoName or Value is neither an atom nor a variable.
     6 --- InfoName is not an information name.

Examples
   
Success:
      [eclipse]: coroutine.
      yes.
      [eclipse]: Var1 > Var2, get_var_info(Var1, Info, Value).

      Var2 = Var2
      Var1 = Var1
      Info = name
      Value = 'Var1'
      Delayed goals:
       Var1 > Var2     More? (;)

      Var2 = Var2
      Var1 = Var1
      Info = type
      Value = suspending

      Delayed goals:
       Var1 > Var2
      yes.

      [eclipse]: get_var_info(Var1, type, Type).

      Var1 = Var1
      Type = free
      yes.
      [eclipse]: set_flag(variable_names,off).

      yes.
      [eclipse]: get_var_info(Var1, name, Name).

      no (more) solution.

Fail:
      get_var_info(atom, name, Name).
      set_flag(variable_names, off),
          get_var_info(X, name, Name).

Error:
      get_var_info(X, not_an_info, Y).    (Error 6)
      get_var_info(X, type, 123).         (Error 5)






See Also
   set_flag / 2, type_of / 2, var / 1
