From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA11547; Fri, 23 Mar 2001 15:37:32 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA11122 for caml-list@pauillac.inria.fr; Fri, 23 Mar 2001 15:37:32 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA27623 for ; Thu, 22 Mar 2001 22:02:55 +0100 (MET) Received: from hebe.or.intel.com (jffdns02.or.intel.com [134.134.248.4]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2ML2rb06154 for ; Thu, 22 Mar 2001 22:02:54 +0100 (MET) Received: from ichips-ra.pdx.intel.com (ichips-ra-hme2.intel.com [10.7.5.35]) by hebe.or.intel.com (8.9.1a+p1/8.9.1/d: relay.m4,v 1.35 2001/02/12 09:03:45 smothers Exp $) with ESMTP id VAA28949 for ; Thu, 22 Mar 2001 21:02:47 GMT Received: from dhpc0010.pdx.intel.com (dhpc0010.pdx.intel.com [10.7.21.33]) by ichips-ra.pdx.intel.com (8.9.1a/8.9.1/d: internal.m4,v 1.2 1998/11/09 19:18:37 iwep Exp iwep $) with ESMTP id NAA02090; Thu, 22 Mar 2001 13:02:47 -0800 (PST) Received: from ichips.intel.com (johnh@localhost [127.0.0.1]) by dhpc0010.pdx.intel.com (8.9.1a/8.9.1/d: client-ra.m4,v 1.1 1998/12/24 19:00:55 jamesw Exp jamesw $) with ESMTP id NAA10479; Thu, 22 Mar 2001 13:02:46 -0800 (PST) Message-Id: <200103222102.NAA10479@dhpc0010.pdx.intel.com> To: caml-list@inria.fr cc: John Harrison Subject: [Caml-list] Custom prettyprinter for polymorphic datatype Date: Thu, 22 Mar 2001 13:02:46 -0800 From: John R Harrison Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk In CAML Light and OCaml, how do I install a custom printer for a polymorphic datatype so that the subcomponents print in the usual way? For example, suppose I decided to print lists with the elements separated by "," instead of ";". (This is a bad idea of course, but serves as a simple example.) Obviously I can write a recursive function that passes over a list and does X at each element, but how do I make X work on arbitrary types? Preferably as part of "X" the custom printer would itself be called recursively if the elements contain more lists. If I could just get hold of a "standard printer" function print_value : 'a->unit then presumably I could use that. Is this possible? Or is there a better way? John. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr