Version française
Home     About     Download     Resources     Contact us    
Browse thread
Print values like the toplevel's printer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: padiolea@i...
Subject: Re: [Caml-list] Print values like the toplevel's printer
> Hi,
>
> I would like to print values to a file in a human-readable manner without
> having to compose the output writers of print_int and friends. In short, I
> would like to use the toplevel's function for screen output of structured
> values.

I recently post a message to allow this (with generic print in the subject
of the message).

the code is available at:
 http://www.irisa.fr/prive/padiolea/hacks/generic_print.ml

example:
  let _ = print_string (generic_print [[1;3];[2;9;8];[3;4]] "int list
list" in
  let _ = print_string (generic_print [1;3;2;9;8;3;4] "int list") in
   ...

 test:
  ./test_generic
  ==>
   [[1; 3]; [2; 9; 8]; [3; 4]]
   [1; 3; 2; 9; 8; 3; 4]




>
> Is there a simple way, a FM or a mailing list you can point me to?



>
> I googled quite a bit, but apparently not with the right terms.
>
> Cheers,
> Wolfgang
> --
> Dr. Wolfgang Müller
> LS AI 1
> Universität Bayreuth
>
> _______________________________________________
> 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
>