This file doc.sections.tpl, last modified on 2001-01-06.
Without any doubt, OCaml is a great langage for Web publishing. I used it for a long time to produce my static web pages and more recently to write some CGI scripts.
HereDoc is an attempt to provide syntactic sugar for such applications.
In OCaml, strings constants can span multiple lines. Of course, this is most useful for the applications we have in mind. But OCaml lacks some imporant features.
print_string ("The value of x is " ^ x ^ ".");
Printf.printf "The value of x is %s." x;
print "The value of x is $x.";
HereDoc relies on Camlp4, the powerful preprocessor for OCaml, to extend the concrete syntax of the language and provide convenient notations for all these operations. Most of the work is done at compile time, so the code is fast.
Go to the first, previous, next, last section, table of contents.