caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Camlp4: generating printers of types
@ 2002-10-09 13:13 Daniel de Rauglaudre
  2002-10-09 17:18 ` Markus Mottl
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-09 13:13 UTC (permalink / raw)
  To: caml-list

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 =
      function
        Red -> print_string "Red"
      | Green -> print_string "Green"
      | Blue -> print_string "Blue"

If you are interested, this is here:
    http://caml.inria.fr/camlp4/tutorial.new/tutorial007.html#toc51

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-12-10 17:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-09 13:13 [Caml-list] Camlp4: generating printers of types Daniel de Rauglaudre
2002-10-09 17:18 ` Markus Mottl
2002-10-25 19:20 ` Ken Rose
2002-10-25 20:02   ` Chris Hecker
2002-10-26  0:11   ` Daniel de Rauglaudre
2002-12-10  2:01 ` Ken Rose
2002-12-10 12:25   ` Daniel de Rauglaudre
2002-12-10 15:33     ` Ken Rose
2002-12-10 17:38       ` Daniel de Rauglaudre
2002-12-10 13:20   ` Damien Doligez

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).