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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-03 (10:16)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] string_of_polymorphic

On Monday 03 January 2005 09:52, Luca Pascali wrote:
> As the subject says, my aim is to write a function that is able to
> covert into a string a generic polymorphic constructor, or at least its
> name, without using patter matching.

Why do you want to do this?

> ...
> Thanks in advance to anyone for hints, or links, or wathever help you
> can give me.

I think the run-time representation of a polymorphic variants' value is a hash 
of its name and, therefore, cannot be mapped back onto a string in general. 
There may be something else you can do specifically for the top-level but I 
can't think what...