English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] marshalling and code changes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-29 (12:49)
From: Oleg <oleg_inconnu@m...>
Subject: [Caml-list] marshalling and code changes

Suppose I use Marshall module (and input_value / output_value pervasives) to 
serialize a sophisticated data type. If I make [small] changes to this data 
type, what is the best way to convert old saved data?

What if the new type is a supertype to the old one, can I load it safely?

I tried it with 

type old_type = Float of float | Int of int ;;
type new_type = Float of float | Int of int | S of string;;

and it seemed to have worked with input_value and output_value.

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