caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] install_printer
Date: Fri, 25 Jan 2002 06:58:14 +0100	[thread overview]
Message-ID: <20020125065814.A28494@verdot.inria.fr> (raw)
In-Reply-To: <86bsfj6q2d.fsf@speakeasy.org>; from itz@speakeasy.org on Thu, Jan 24, 2002 at 07:56:58PM -0800

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


  reply	other threads:[~2002-01-25  5:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-25  3:56 Ian Zimmerman
2002-01-25  5:58 ` Daniel de Rauglaudre [this message]
2002-01-25  6:34   ` Ian Zimmerman
2002-01-25  9:53     ` Daniel de Rauglaudre
2002-01-28 12:31       ` M E Leypold @ labnet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020125065814.A28494@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).