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 HAA29559; Fri, 25 Jan 2002 07:34:59 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA29685 for ; Fri, 25 Jan 2002 07:34:58 +0100 (MET) Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0P6Yuv02669 for ; Fri, 25 Jan 2002 07:34:57 +0100 (MET) Received: (qmail 26829 invoked from network); 25 Jan 2002 06:34:54 -0000 Received: from unknown (HELO kronstadt) ([64.81.49.223]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 25 Jan 2002 06:34:54 -0000 Received: from itz by kronstadt with local (Exim 3.33 #1 (Debian)) id 16Tzwr-0003JO-00 for ; Thu, 24 Jan 2002 22:34:53 -0800 To: caml-list@inria.fr (OCAML) Subject: Re: [Caml-list] install_printer References: <86bsfj6q2d.fsf@speakeasy.org> <20020125065814.A28494@verdot.inria.fr> From: Ian Zimmerman Date: 24 Jan 2002 22:34:53 -0800 In-Reply-To: <20020125065814.A28494@verdot.inria.fr> Message-ID: <868zaney5u.fsf@speakeasy.org> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk itz> Hi, I can hook into the toplevel loop to modify printing of simple itz> types like int with #install_printer, but what about polymorphic itz> types? Daniel> For a general printing of all values of all types, use the hook Daniel> Toploop.print_out_value. You can change it to point to your function. Daniel> This function must take a value of type Outcometree.out_value and Daniel> print it. The module Outcometree is in the installed OCaml library Daniel> directory. Daniel> The default value of !Toploop.print_out_value is the function "print_outval" Daniel> located in the OCaml sources file toplevel/genprintval.ml. You can make your Daniel> own version by copying this function and adapt it for your own usage. Daniel> Another example is the "revised syntax" of Camlp4 in the OCaml Daniel> sources, file "camlp4/top/rprint.ml". (use "camlp4r pr_o.cmo Daniel> camlp4/top/rprint.ml" to see this file in normal syntax, if you Daniel> prefer). Thanks. I take it that your answer is 3.04 specific; actually I am working with 3.02. I will just wait with this functionality until I upgrade. Pretty amazing that it _is_ now possible, really. :-) Maybe because you needed something like it for p4? -- Ian Zimmerman, Oakland, California, U.S.A. GPG: 433BA087 9C0F 194F 203A 63F7 B1B8 6E5A 8CA3 27DB 433B A087 In his own soul a man bears the source from which he draws all his sorrows and his joys. Sophocles. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr