From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 38B92BB9C for ; Wed, 16 Nov 2005 19:44:35 +0100 (CET) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.194]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jAGIiYRT002042 for ; Wed, 16 Nov 2005 19:44:35 +0100 Received: by nproxy.gmail.com with SMTP id o25so349531nfa for ; Wed, 16 Nov 2005 10:44:34 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=E+MdodsEPV6BDd9XQ0mXUcmraBa6U5BNylawhi/CFS0VCiqSEJzI6SMTwyiPHVudJgx9tJL5nWjEcvVZ0DoRRvrxuzWAviGWImjSIbmd4WHNUZr177NBrnSEm31ShYMmVb+qs+ucBHROMUZ4UFhuJ66pJujic51m4zxZbm2Qmx4= Received: by 10.49.2.10 with SMTP id e10mr323747nfi; Wed, 16 Nov 2005 10:44:34 -0800 (PST) Received: by 10.49.2.3 with HTTP; Wed, 16 Nov 2005 10:44:34 -0800 (PST) Message-ID: Date: Wed, 16 Nov 2005 18:44:34 +0000 From: Chris Campbell To: caml-list@yquem.inria.fr Subject: Polymorphic variant to string? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 437B7E12.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; variants:01 camlp:01 variants:01 cheers:01 polymorphic:01 polymorphic:01 strings:01 variant:02 variant:02 match:02 string:02 unit:03 module:03 library:03 compiled:04 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hi, 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? Cheers, Chris