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=2.2 required=5.0 tests=DATE_IN_PAST_12_24,SPF_FAIL 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 37435BC0A for ; Fri, 15 Jun 2007 11:48:26 +0200 (CEST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5F9mPbG025605 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jun 2007 11:48:26 +0200 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Hz8Cs-0007GD-RK for caml-list@inria.fr; Fri, 15 Jun 2007 11:35:03 +0200 Received: from darboux.math.univ-montp2.fr ([162.38.126.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jun 2007 11:35:02 +0200 Received: from michael.grunewald by darboux.math.univ-montp2.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jun 2007 11:35:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: =?utf-8?b?TWljaGHDq2wgR3LDvG5ld2E=?= =?utf-8?b?bGQ=?= Subject: Automatically install printer Date: 14 Jun 2007 14:28:51 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: darboux.math.univ-montp2.fr User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Sender: news X-j-chkmail-Score: MSGID : 46726069.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46726069.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; toplevel:01 ocaml':01 toplevel:01 ocaml':01 functor:01 functor:01 cheers:01 define:01 types:03 module:03 install:05 install:05 directive:05 directive:05 uses:06 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. -- cheers, Michaƫl