From: Ian Zimmerman <itz@speakeasy.org>
To: caml-list@inria.fr (OCAML)
Subject: Re: [Caml-list] install_printer
Date: 24 Jan 2002 22:34:53 -0800 [thread overview]
Message-ID: <868zaney5u.fsf@speakeasy.org> (raw)
In-Reply-To: <20020125065814.A28494@verdot.inria.fr>
itz> Hi, I can hook into the toplevel loop to modify printing of simple
itz> types like int with #install_printer, but what about polymorphic
itz> types?
Daniel> For a general printing of all values of all types, use the hook
Daniel> Toploop.print_out_value. You can change it to point to your function.
Daniel> This function must take a value of type Outcometree.out_value and
Daniel> print it. The module Outcometree is in the installed OCaml library
Daniel> directory.
Daniel> The default value of !Toploop.print_out_value is the function "print_outval"
Daniel> located in the OCaml sources file toplevel/genprintval.ml. You can make your
Daniel> own version by copying this function and adapt it for your own usage.
Daniel> Another example is the "revised syntax" of Camlp4 in the OCaml
Daniel> sources, file "camlp4/top/rprint.ml". (use "camlp4r pr_o.cmo
Daniel> camlp4/top/rprint.ml" to see this file in normal syntax, if you
Daniel> prefer).
Thanks. I take it that your answer is 3.04 specific; actually I am
working with 3.02. I will just wait with this functionality until I
upgrade.
Pretty amazing that it _is_ now possible, really. :-) Maybe because
you needed something like it for p4?
--
Ian Zimmerman, Oakland, California, U.S.A.
GPG: 433BA087 9C0F 194F 203A 63F7 B1B8 6E5A 8CA3 27DB 433B A087
In his own soul a man bears the source
from which he draws all his sorrows and his joys.
Sophocles.
-------------------
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
next prev parent reply other threads:[~2002-01-25 6:34 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
2002-01-25 6:34 ` Ian Zimmerman [this message]
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=868zaney5u.fsf@speakeasy.org \
--to=itz@speakeasy.org \
--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