English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Learning Objective CAML for C, C++, Perl and Java programmers: