Version française
Home     About     Download     Resources     Contact us    
Browse thread
Quotes inside a comment ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@m...>
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

	http://www.triode.net.au/~skaller/interscript

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
that way.

-- 
John Skaller, mailto:skaller@maxtal.com.au
1/10 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
downloads: http://www.triode.net.au/~skaller