Defining own types printers.

michel@lri.fr
Wed, 21 Apr 1993 19:13:57 +0200 (MET DST)

From: michel@lri.fr
Message-Id: <9304211713.AA02411@sun7d.lri.fr>
Subject: Defining own types printers.
To: caml-light@margaux (Caml Light Mailing list)
Date: Wed, 21 Apr 1993 19:13:57 +0200 (MET DST)

Hi,

I have some user-defined types , and I'd like to have them printed the
ritgh way under caml-ligth when I just want to see the contents of a var ->

Ex:

---
#x1;;
- : t_bdd_tree = cNode {label="x1"; alors=cNode {label="x2"; alors=cNode {label="x3"; alors=cTerm false; sinon=cTerm false}; sinon=cNode {label="x3"; alors=cTerm
 false; sinon=cTerm true}}; sinon=cNode {label="x2"; alors=cNode {label="x3"; alors=cTerm false; sinon=cTerm true}; sinon=cNode {label="x3"; alors=cTerm false; s
inon=cTerm true}}}
#

I'd like to see ->

#print_bdd x1;; (x1, (x2, (x3, 0, 0), (x3, 0, 1)), (x2, (x3, 0, 1), (x3, 0, 1)))- : unit = ()

I see at the page #231 of the Caml-light ref manual, that the chapter will deal with Streams, parsers and printers but there's nothing concerning user-defined printers (like in CAML).

My question is : Is it possible to attach printers to user defined types ?

BTW, I wrote in english, since there might be some non-french readers reading this question.

Thank you in advance.

-- 
  Olivier MICHEL                           Email : michel@lri.lri.fr 
  Laboratoire LRI - Universite PARIS_SUD         : michel@FRLRI61.BITNET
  Bat. 490- bureau 69                      Fax   : 33-1-64-46-19-92
  91405 ORSAY CEDEX                        Phone : 33-1-69-41-65-79
  FRANCE                                   

"if you're not programming functionally, then you must be programming dysfunctionally"