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 GAA28969; Fri, 25 Jan 2002 06:58:15 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 GAA29518 for ; Fri, 25 Jan 2002 06:58:15 +0100 (MET) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0P5wEf02794 for ; Fri, 25 Jan 2002 06:58:14 +0100 (MET) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id GAA28514 for caml-list@inria.fr; Fri, 25 Jan 2002 06:58:14 +0100 Date: Fri, 25 Jan 2002 06:58:14 +0100 From: Daniel de Rauglaudre To: OCAML Subject: Re: [Caml-list] install_printer Message-ID: <20020125065814.A28494@verdot.inria.fr> References: <86bsfj6q2d.fsf@speakeasy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <86bsfj6q2d.fsf@speakeasy.org>; from itz@speakeasy.org on Thu, Jan 24, 2002 at 07:56:58PM -0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Thu, Jan 24, 2002 at 07:56:58PM -0800, Ian Zimmerman wrote: > Hi, I can hook into the toplevel loop to modify printing of simple > types like int with #install_printer, but what about polymorphic > types? For a general printing of all values of all types, use the hook Toploop.print_out_value. You can change it to point to your function. This function must take a value of type Outcometree.out_value and print it. The module Outcometree is in the installed OCaml library directory. The default value of !Toploop.print_out_value is the function "print_outval" located in the OCaml sources file toplevel/genprintval.ml. You can make your own version by copying this function and adapt it for your own usage. Another example is the "revised syntax" of Camlp4 in the OCaml sources, file "camlp4/top/rprint.ml". (use "camlp4r pr_o.cmo camlp4/top/rprint.ml" to see this file in normal syntax, if you prefer). -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- 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