Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Camlp4: generating printers of types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: [Caml-list] Camlp4: generating printers of types
Hi everybody,

In Camlp4 tutorial (current version), I added a section explaining how
to make a syntax extension which, when loaded, automatically generates
printers of all your types:

For example, if your input file contains:

    type colour = Red | Green | Blue

this will be interpreted like this:

    type colour = Red | Green | Blue
    let print_colour =
        Red -> print_string "Red"
      | Green -> print_string "Green"
      | Blue -> print_string "Blue"

If you are interested, this is here:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: