
read_exdr(+Stream, -Term)

   A term in EXDR-format is read from the input stream Stream and
converted to the corresponding ECLiPSe term Term.



Arguments
   +Stream             Integer (stream number) or Atom (symbolic stream name).
   -Term               A variable.

Type
   Term I/O

Description
    The predicates write_exdr/2 and read_exdr/2 can be used for letting
    ECLiPSe programs exchange data with the host language in an embedded
    environment (e.g.  VB, Tcl).  More generally, they allow exchanging
    data with agents written in programming languages that define a
    mapping from EXDR format to the language's data structures.


    EXDR defines the abstract data types Integer, Double, String, List,
    Nil, Struct and Anonymous Variable. Their mapping to ECLiPSe data
    types is as follows:



        EXDR type       ECLiPSe type        e.g.
        ----------------------------------------------
        Integer         integer             123
        Double          float               12.3
        String          string              "abc"
        List            ./2                 [a,b,c]
        Nil             []/0                []
        Struct          compound or atom    foo(bar,3)
        Anon.Variable   var                 _

    Not all ECLiPSe terms have an EXDR representation, e.g. big integers,
    rationals, suspensions or attributed variables.




Resatisfiable
      No.

Fail Conditions
      Fails when reaching end of file.



Exceptions
     4 --- Stream is not instantiated.
     5 --- Stream is not an atom or an integer.
     7 --- EXDR term corrupted.
   190 --- End of file (default handler fails)
   192 --- Stream is not an input stream.
   193 --- Stream is an illegal stream specification.
   264 --- Not EXDR format.
   265 --- Unknown EXDR format version.

Examples
   
Success:
    [eclipse 4]: open(queue(""),update,q),
                 write_exdr(q, foo(12.3,123,["hello",_])),
                 read_exdr(q, Term),
                 close(q).

    Term = foo(12.3, 123, ["hello", _131])
    yes.

Error:
    read_exdr(S, a(b,c)).    (Error 4).
    read_exdr(input, X).     (Error 192).
    read_exdr(atom, X).      (Error 193).





See Also
   write_exdr / 2, read / 1, read / 2
