EXDR (ECLiPSe External Data Representation, see also chapter 9) is a data encoding that allows to represent a significant subset of the ECLiPSe data types. The following Tcl primitives are provided to handle EXDR-format:
Since Tcl is an untyped language, all commands which create EXDR terms accept, in addition to the data, an optional format argument which allows all EXDR data types to be specified. The syntax is as follows:
To create EXDR type use <format> data required String S string (binary) String U string (utf8) Integer/Long I integer Double D double List [<formats>] fixed length list List [<formats>*] list Struct (<formats>) fixed list, first elem functor name Struct (<formats>*) list, first elem functor name Anonymous Variable _ string "_"
Here are some examples that show which Tcl data/format pair corresponds to which ECLiPSe term (the curly brackets are just Tcl quotes and not part of the format string):
Tcl data Tcl format Eclipse term hello S "hello" hello () hello 123 S "123" 123 I 123 123 D 123.0 123 () '123' {a 3 4.5} {[SID]} ["a", 3, 4.5] {a 3 4.5} S "a 3 4.5" {1 2 3 4} {[I*]} [1, 2, 3, 4] {f 1 2 3} {(I*)} f(1,2,3) {is _ {- 1 2}} {(_(II))} _ is 1-2