On Fri, 24 Nov 2006, Francois Colonna wrote:
> Thanks for the reference.
> I do not understand why should I preprocess the *.ml file to use streams.
> Streams are part of the language, aren't they ?
Kind of 
The Stream module is part of the standard library and allows to
manipulate streams without a particular syntax, which is not very
convenient.
That said, there has always been a special syntax to manipulate streams,
but it used to be available by default. It was documented as an
experimental extension of the language, which could be removed in future
versions. This is what actually happened.
At the same time, camlp4 had been included into the core OCaml
distribution. Camlp4 is a preprocessor for OCaml, so it parses the core
OCaml language, and also the special syntax for streams. This is what
should be used. The command which parses OCaml files written in the
standard syntax + streams is camlp4o.
Conclusions:
1) When compiling using OCamlMakefile, put this as the first line of the
files that use the stream syntax:
(*pp camlp4o *)
2) When compiling directly with ocamlfind, use this flag: -syntax camlp4o
3) When compiling without ocamlfind, pass this flag to ocamlopt or ocamlc:
-pp camlp4o
Martin
--
Martin Jambon, PhD
http://martin.jambon.free.fr
.