<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/456e9b58a2d15ef6607ce28e63730b98"
  from="Christian Rinderknecht &lt;christian.rinderknecht@d...&gt;"
  author="Christian Rinderknecht"
  date="2003-10-10T09:18:26"
  subject="Re: [Caml-list] extending a type with Marshal"
  prev="2003/10/01e735513b420daaa4fb449831e17655"
  next="2003/10/a3da23be7d7c2dd4fa3153c628eb9588"
  prev-in-thread="2003/10/7f6be26678d11fcb04f13cb5c61e23c5"
  next-in-thread="2003/10/292081aed310039449f69c2d9d0ed30c"
  prev-thread="2003/10/d04befa7beb24ef22b9d02a9066de8f7"
  next-thread="2003/10/33325f78a6172641c92e0e567b9af6af"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] extending a type with Marshal">
<msg 
  url="2003/10/23020cf3ef994a55faf67bc004acf3fd"
  from="Ker Lutyn &lt;ker527mail@y...&gt;"
  author="Ker Lutyn"
  date="2003-10-08T21:23:00"
  subject="[Caml-list] extending a type with Marshal">
<msg 
  url="2003/10/93e1c7f56863457dc0bcda7f8d33d6e5"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-10-08T21:38:49"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/d149b67fa1588802d67be2ed6b3d5855"
  from="Peter Jolly &lt;peter@j...&gt;"
  author="Peter Jolly"
  date="2003-10-08T21:52:10"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/7f6be26678d11fcb04f13cb5c61e23c5"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-10-10T08:39:03"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/456e9b58a2d15ef6607ce28e63730b98"
  from="Christian Rinderknecht &lt;christian.rinderknecht@d...&gt;"
  author="Christian Rinderknecht"
  date="2003-10-10T09:18:26"
  subject="Re: [Caml-list] extending a type with Marshal">
<msg 
  url="2003/10/292081aed310039449f69c2d9d0ed30c"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-10-10T10:38:44"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/8dc99151763f5627ce8027b84206cca2"
  from="Martin Berger &lt;martinb@d...&gt;"
  author="Martin Berger"
  date="2003-10-10T17:19:37"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/98526a6ccb2c8a13f822988a31ca0018"
  from="William Chesters &lt;williamc@p...&gt;"
  author="William Chesters"
  date="2003-10-12T08:58:53"
  subject="Re: [Caml-list] extending a type with Marshal">
<msg 
  url="2003/10/7f3508d9a8e763ca3c4814a1f987ad8e"
  from="William Chesters &lt;williamc@p...&gt;"
  author="William Chesters"
  date="2003-10-12T09:03:15"
  subject="Re: [Caml-list] extending a type with Marshal">
</msg>
<msg 
  url="2003/10/13d1b30fa399c79b0b95a64690887b94"
  from="David MENTRE &lt;dmentre@l...&gt;"
  author="David MENTRE"
  date="2003-10-12T19:45:12"
  subject="About ASN.1 and network encoding (was: Re: [Caml-list] extending a type with Marshal)">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Hello Ker,

On Wed, 2003-10-08 at 23:22, Ker Lutyn wrote:
&gt; [...]
&gt; In other words, Foo sends message A to Bar. We'd like to be able to
&gt; handle two possibilities:
&gt; 
&gt; (1) Foo sends message A' to Bar, who interprets it as A.
&gt; (2) Foo sends message A to Bar, who interprets it as A'.
&gt; 
&gt; ...where A' is an extension of A.
&gt; 
&gt; To do this it would be necessary to 'extend' a type at one end [...]

This kind of concept is already present (subtyping, versioning,
relaying) in a specification language called Abstract Syntax Notation
One (ASN.1), and, at least, easily supported by one of its encoding rule
called Basic Encoding Rule (BER).

The point of ASN.1 is sharing the same ASN.1 module between the two
possibly hetereogeneous peers, also agreeing on an encoding/decoding
scheme (e.g. BER) and then each peer compile the ASN.1 module into type
definitions and codecs in his application language (obviously, you seems
interested in O'Caml). Then compile and link.

In my PhD thesis I wrote a parser and a checker for ASN.1:1988/90, but
no code generation for O'Caml. I remember that Erlang had such a
facility integrated transparently. It is worth looking this way.

For all information about ASN.1, see the excellent site of France
Telecom R&amp;D at http://asn1.elibel.tm.fr/. By the way, these folks
develop some ASN.1 tools in O'Caml, but do not disclose their source
code in general.


Hope this helps,


Christian

-- 
---------------------------------------------------------------------------
Christian Rinderknecht                        Phone: +33 1 41 16 70 39
Assistant Professor                           Fax:   +33 1 41 16 71 71
D.E.R. Genie Informatique (ESILV)
Pole Universitaire Leonard de Vinci
F-92916 Paris La Defense Cedex (France)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

