caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Quotes inside a comment ?
@ 1999-10-13 12:30 Juergen Pfitzenmaier
  1999-10-14 19:17 ` Gerd Stolpmann
  1999-10-14 22:38 ` skaller
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Pfitzenmaier @ 1999-10-13 12:30 UTC (permalink / raw)
  To: caml-list

The documentation says even inside comments the quotes (that's -- " --)
have to be used pairwise. Is there any reason for this ?
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 ?

ciao pfitzen




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Quotes inside a comment ?
  1999-10-13 12:30 Quotes inside a comment ? Juergen Pfitzenmaier
@ 1999-10-14 19:17 ` Gerd Stolpmann
  1999-10-14 22:38 ` skaller
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Stolpmann @ 1999-10-14 19:17 UTC (permalink / raw)
  To: Juergen Pfitzenmaier; +Cc: caml-list

On Wed, 13 Oct 1999, Juergen Pfitzenmaier wrote:
>The documentation says even inside comments the quotes (that's -- " --)
>have to be used pairwise. Is there any reason for this ?

To comment code out, e.g.

(* print_string "*)" *)

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

If it is Latex why don't you use the inputenc package? If not, I don't have
an easy answer.

Gerd
--
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   Gerd.Stolpmann@darmstadt.netsurf.de (privat)
Germany                     
----------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Quotes inside a comment ?
  1999-10-13 12:30 Quotes inside a comment ? Juergen Pfitzenmaier
  1999-10-14 19:17 ` Gerd Stolpmann
@ 1999-10-14 22:38 ` skaller
  1 sibling, 0 replies; 3+ messages in thread
From: skaller @ 1999-10-14 22:38 UTC (permalink / raw)
  To: Juergen Pfitzenmaier; +Cc: caml-list

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-10-15  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-13 12:30 Quotes inside a comment ? Juergen Pfitzenmaier
1999-10-14 19:17 ` Gerd Stolpmann
1999-10-14 22:38 ` skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).