Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] install_printer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-01-25 (05:58)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] install_printer

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

The default value of !Toploop.print_out_value is the function "print_outval"
located in the OCaml sources file toplevel/ 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/". (use "camlp4r pr_o.cmo
camlp4/top/" to see this file in normal syntax, if you

Bug reports:  FAQ:
To unsubscribe, mail  Archives: