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
Polymorphic variant to string?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-16 (18:44)
From: Chris Campbell <cyberdanx@g...>
Subject: Polymorphic variant to string?

Is there a general method for converting polymorphic variants to
strings?  The method using camlp4 assumes the source is compiled with
it, which is not the case.  Basically I want to print a list of
variants if a unit tests fail, so we can see exactly the contents of
the list at that point.

The polymorphic variant type resides in a library and is used by a
module in my program.  I need to check the values returned match which
is easy, except when the code tested is erroneous and I want to see
what's going on.

Any ideas?  Suggestions?