Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: skaller <skaller@maxtal.com.au>
To: Juergen Pfitzenmaier <pfitzen@informatik.uni-tuebingen.de>
Cc: caml-list@inria.fr
Subject: Re: Quotes inside a comment ?
Date: Fri, 15 Oct 1999 08:38:29 +1000	[thread overview]
Message-ID: <38065B65.4BE00CC3@maxtal.com.au> (raw)
In-Reply-To: <199910131230.OAA15829@sunstroke.informatik.uni-tuebingen.de>

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




      parent reply	other threads:[~1999-10-15  6:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-13 12:30 Juergen Pfitzenmaier
1999-10-14 19:17 ` Gerd Stolpmann
1999-10-14 22:38 ` skaller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38065B65.4BE00CC3@maxtal.com.au \
    --to=skaller@maxtal.com.au \
    --cc=caml-list@inria.fr \
    --cc=pfitzen@informatik.uni-tuebingen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox