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] Quotes in comments: (* " *)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-17 (17:02)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Quotes in comments: (* " *)
I've had a few replies along the lines that "(*" or "*)" is valid
code, and hence all this quoting comments stuff is justified.  I have
to say that writing such code is amazingly rare (perhaps only compiler
writers will write this, and then only once in their lives), whereas
I've encountered the problems with quotes in comments routinely since
I started using OCaml.  I doubt I'm alone in this.  I actually have
a small collection of programs now which have lines like this:

  (* ... some comment which contains an odd number of quotes ...

  [Keep OCaml compiler happy -->] " *)

I think the behaviour is counter-intuitive, and should be classified
as a bug, along with the other annoyance of being unable to write
let f = printf "** %i" and have it do what you expect.


Richard Jones.
Merjis Ltd. - improving website return on investment
Learning Objective CAML for C, C++, Perl and Java programmers: