caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Florent.Ouchet@imag.fr
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ocamldebug: User-defined printers for abstract data types?
Date: Sat, 27 Mar 2010 13:58:14 +0100	[thread overview]
Message-ID: <20100327135814.25675icryz1zvx7q@webmail.imag.fr> (raw)
In-Reply-To: <1269690338.3027.41.camel@ratschan-laptop>

Hello,

The printing of Big_int is possible and AFAIK Big_int is an abstract  
data type.

The following code is part of DebugPrinter.ml in VSYML [1]:

(** custom debug printer for big_int values (why is it missing in  
vanilla ocaml?)
   @param value_big_int the value to be printed
   @return unit *)
let print_big_int (value_big_int:Big_int.big_int) =
   Format.printf "%s" (Big_int.string_of_big_int value_big_int);;

And it is loaded by the following commands in the debugger:
load_printer build/debug/DebugPrinter.cmo
install_printer DebugPrinter.print_big_int

[1] VSYML VHDL Symbolic Simulator in OCaml  
http://users-tima.imag.fr/vds/ouchet/vsyml.ml

- Florent

Stefan Ratschan <stefan.ratschan@cs.cas.cz> a écrit :

> The ocamldebug manual entry for load_printer says: "The loaded file does
> not have direct access to the modules of the program being debugged."
>
> So I have to put the whole printer definition into the loaded file. But
> then, how can one write a printer for abstract data types? External
> files do not have access to those.
>
> Stefan Ratschan
>
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


      reply	other threads:[~2010-03-27 12:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-27 11:45 Stefan Ratschan
2010-03-27 12:58 ` Florent.Ouchet [this message]

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=20100327135814.25675icryz1zvx7q@webmail.imag.fr \
    --to=florent.ouchet@imag.fr \
    --cc=caml-list@yquem.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).