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
Automatically install printer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-15 (14:25)
From: David Teller <David.Teller@e...>
Subject: Re: [Caml-list] Automatically install printer
I concur that this would be nice.


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.