caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Automatically install printer
@ 2007-06-14 12:28 Michaël Grünewald
  2007-06-15 14:25 ` [Caml-list] " David Teller
  0 siblings, 1 reply; 2+ messages in thread
From: Michaël Grünewald @ 2007-06-14 12:28 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Automatically install printer
  2007-06-14 12:28 Automatically install printer Michaël Grünewald
@ 2007-06-15 14:25 ` David Teller
  0 siblings, 0 replies; 2+ messages in thread
From: David Teller @ 2007-06-15 14:25 UTC (permalink / raw)
  To: Michaël Grünewald; +Cc: caml-list

I concur that this would be nice.

Cheers,
 David

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-15 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-14 12:28 Automatically install printer Michaël Grünewald
2007-06-15 14:25 ` [Caml-list] " David Teller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).