From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 00D5FBC0A for ; Fri, 15 Jun 2007 16:25:34 +0200 (CEST) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5FEPXmS028740 for ; Fri, 15 Jun 2007 16:25:34 +0200 Received: by wr-out-0506.google.com with SMTP id 37so99855wra for ; Fri, 15 Jun 2007 07:25:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=s2PH0+ovm+MyCrCOdSBxY4rcnBrxan8vKUjWFkHOE47RTg4+wkndvw4W0OxceGW8rrICB5ct+08VqXVuV2WFUe2NDBBeK4LNCE1VLq6KM6gXq5OpbFJ+evEfokqRDzhv6AQpzs/ZNf9VSANWWPAd1IvCQ7LtDCr5r+VtDecmrrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=fBwXP4paMDgQn8bXVTgMfgRFa3JP1vwXQ0AKWzEnB14JWXlubf8OXVAC559Tfrf4Ad4qVVRimu823deuHy3EOxqdGFkrd82qd7wmHKxhTqzz92RUnYgGAaqFSajyGwvnK6WkEMasnGc6UDzfkLHXKRrjTC716t/LG10wN+1O5aw= Received: by 10.90.25.3 with SMTP id 3mr2565293agy.1181917533398; Fri, 15 Jun 2007 07:25:33 -0700 (PDT) Received: from ?192.168.0.1? ( [82.246.197.195]) by mx.google.com with ESMTP id i7sm301510nfh.2007.06.15.07.25.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 Jun 2007 07:25:32 -0700 (PDT) Subject: Re: [Caml-list] Automatically install printer From: David Teller To: =?ISO-8859-1?Q?Micha=EBl_Gr=FCnewald?= Cc: caml-list@inria.fr In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Date: Fri, 15 Jun 2007 16:25:27 +0200 Message-Id: <1181917527.14726.28.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit Sender: David Teller X-Miltered: at discorde with ID 4672A15E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 cheers:01 0200,:01 newald:01 toplevel:01 ocaml':01 toplevel:01 ocaml':01 functor:01 functor:01 wrote:01 caml-list:01 define:01 types:03 module:03 I concur that this would be nice. Cheers, David On Thu, 2007-06-14 at 14:28 +0200, Michaël Grünewald wrote: > Hi all, > > the toplevel `ocaml' allows to install printers for custom types > with the `#install_printer' directive. Is this possible to do this > automatically? > > Being more precise, if I define module `F' made of a type `t' and a > `to_string' function, can I arrange so that the toplevel uses function > `F.to_string' to print `F.t' values? I can use a wrapper script around > the `ocaml' command that will issue the directive before giving back the > hand, but this would break if `F' happens to be a functor: only the > functor instantiation knows what the correct directive is.