Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] extending a type with Marshal
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-08 (21:23)
From: Ker Lutyn <ker527mail@y...>
Subject: [Caml-list] extending a type with Marshal
Marshal provides a convenient way to pass information between
components. It requires that types be the same at either end. But for
multi-machine production systems that must serve traffic continuously,
you cannot count on upgrading all your systems simultaneously.

It is reasonable to want to add capabilities to, say, a web server, in
a backward compatible way so that, say, a legacy content server can
still be used. Later a new content server can be deployed that
responds to the new capabilities. Conversely, we might want to augment
the content server with additional information that will later be used
by an upgraded web server.

    Foo -- A --> Bar

In other words, Foo sends message A to Bar. We'd like to be able to
handle two possibilities:

(1) Foo sends message A' to Bar, who interprets it as A.
(2) Foo sends message A to Bar, who interprets it as A'.

...where A' is an extension of A.

To do this it would be necessary to 'extend' a type at one end of a
Marshal connection without extending it at the other end. Is this
possible? Do people have any suggestions?

Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: