Date: Fri, 15 Oct 1999 08:38:29 +1000
From: skaller <firstname.lastname@example.org>
To: Juergen Pfitzenmaier <email@example.com>
Subject: Re: Quotes inside a comment ?
Juergen Pfitzenmaier wrote:
> The documentation says even inside comments the quotes (that's -- " --)
> have to be used pairwise. Is there any reason for this ?
Yes. it is to allow " ... (* ... " as a string in ocaml code,
which can be itself wrapped correctly in (* .. code .. *) comments,
to hide the code. That is, it is a 'hack' to allow comments to be
used for conditional compilation as well as documentation.
> I would like to have a good documentation for the code I write and my
> preferred way is to use nuweb and put some TeX right beside the piece
> of code it refers to.
> But sometimes I have to use a non-english language
> for the comments and then I need special characters that are constructed
> with a -- " -- in front of them. The only way to use these comments
> with ocaml is to filter all comments out before compiling. This is no
> big deal but it is not nice and easy. Is there any change in sight ?
One solution is to use Interscript as a literate programming tool,
instead of nuweb. See
Interscript understands utf-8, and also permits other inputs
including latin-1. The correct way to support extended characters
is to use \uXXXX and \uXXXXXXXX escapes. You can also switch
to Omega/Lambda as a typesetter (Omega is a unicode version of TeX,
Lambda is the corresponding LaTeX).
Because Interscript is an extension of the powerful Python
scripting language, you can program custom documentation extraction
for embedded comments, thus side-stepping any problems with
ocaml comments. You can also implement conditional compilation
-- John Skaller, mailto:firstname.lastname@example.org 1/10 Toxteth Rd Glebe NSW 2037 Australia homepage: http://www.maxtal.com.au/~skaller downloads: http://www.triode.net.au/~skaller
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:27 MET