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] O'Caml looks at the contents of comments?!
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-09-13 (10:44)
From: Jim Farrand <jim@f...>
Subject: [Caml-list] O'Caml looks at the contents of comments?!
I've spent a long time puzzling over a "string not terminated" error
which was being reported inside a class I'm writing.  Camlp4r reported
the error just as being somewhere in the class (i.e. Line 267 character
4 - 1076) which gave me quite a bit of code to look over.  I spent a
long while staring at the code quite puzzled because I couldn't see an
unterminated string anywhere.

Eventually I started commenting out bits of code, and I was even more
confused when I'd commented out the entire class and STILL got the

Eventually I traced the error to an unterminated string inside a
comment.  This strikes me as slightly odd behaviour - one of the first
things comp sci students are taught about comments is that the compiler
ignores them.  As this has been my experience for many years it took me
a long time to even consider that I could have a syntax error inside a

So why is this restriction enforced?

To be fair, it seems that the when compiling without the camlp4
preprocessor, the error message points out the problem very clearly, and
so it wouln't stump people like it did me, and obviously I won't ever be
confused by it again, now I know.  STill I'm curious about why this
should be an error.


Jim Farrand
NB: I have a spam-filter on my e-mail account.  The first time you e-mail
me you may be asked to confirm your e-mail address before the system delivers
your mail.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: