EXDR Data Interchange Format

# Chapter 9 EXDR Data Interchange Format

We have defined a data interchange format called EXDR for the communication between ECLiPSe and other languages. The data types available in this format are integer, double, string, list, nil, structure and anonymous variable. This is intended to be the subset of ECLiPSe types that has a meaningful mapping to many other languages’ data types. The mapping onto different languages is given in the following table. For details of the mapping between Java classes/interfaces and EXDR/ECLiPSe types see Section 8.3.1.

> EXDR type | ECLiPSe type | TCL type | Java type
> Integer | integer | int | java.lang.Integer
> e.g. | 123 | 123 | 123
> Long | integer | string | java.lang.Long
> e.g. | 5000000000 | 5000000000 | 5000000000
> Double | float | double | java.lang.Double/Float
> e.g. | 12.3 | 12.3 | 12.3
> String | string | string | java.lang.String
> e.g. | "abc" | abc | "abc"
> List | ./2 | list | java.util.Collection
> e.g. | [a,b,c] | {a b c} |
> Nil | [ ]/0 | empty string | java.util.Collection
> e.g. | [ ] | {} "" |
> Struct | compound | list | CompoundTerm/Atom
> e.g. | foo(bar,3) | {foo bar 3} |
> Variable | variable | string | null
> e.g. | _ | _ |

The EXDR Integer data type is a 32-bit signed integer, the EXDR Long data type is a 64-bit signed integer, bigger ECLiPSe integers cannot be represented. The EXDR Variable type only allows singleton, anonymous variables, which means that it is not possible to construct a term where a variable occurs in several places simultaneously. The main use of these variables is as placeholders for result arguments in remote procedure calls.

- ECLiPSe primitives to read/write EXDR terms
- Serialized representation of EXDR terms