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
marshalling objects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-26 (06:44)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] marshalling objects
Jacques Le Normand wrote:
> hello caml list,
> if I marshal an object of class c and I write the result in a file 
> foo.txt and, later on, I add methods to c, can I read the object in 
> foo.txt and call the new methods on the object?

First, a *.txt extension for a binary file (written thru Marshal.* 
functions) is very confusing.

Second, marshalling of any closures (including methods shared by 
objects) can only be unmarshalled by the exact same binary. So if you 
add/change code, it should not work.

email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***