<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Steve Pepper wrote:<br>
<blockquote cite="mid:013401c85c10$3a20f650$0800000a@huchu" type="cite">
<pre wrap="">Multi-line comments are therefore an absolute must for me.
</pre>
</blockquote>
The same for me.<br>
<br>
(The little experience I got when writing documents in CTM as of
<a class="moz-txt-link-freetext" href="http://www.itscj.ipsj.or.jp/sc34/open/0935.htm">http://www.itscj.ipsj.or.jp/sc34/open/0935.htm</a> provided that insight.)<br>
<br>
As I can see, there are these variants being discussed:<br>
<ol>
<li>single-line-comments</li>
<li>multi-line-comments</li>
<ol>
<li>non-nestable</li>
<li>nestable</li>
</ol>
</ol>
Nestable comments have the technical disadvantage of making a language
non-regular. However, for practical matters, this is not really an
issue, there are techniques known for nearly all parser generators to
handle nesting comments. As I plan to write a CTM parser as well (and
gained some experience when trying write a usable grammar for CTM as of
0935.htm), I think the advantages of nestable comments outweigh the
additional effort needed, namely allowing to simply place a
comment-start-sequence somewhere and a comment-end-sequence somewhere
else and it "just works". I consider the example<br>
<blockquote>Robert Barta wrote: <br>
<blockquote cite="mid:20080118185337.GD3570@mando.int.devc.at"
type="cite">
<pre wrap="">-----------------------------------
/* this is /* also a comment */
but is this still comment ? */
------------------------------------
</pre>
</blockquote>
</blockquote>
to be a very practical one.<br>
<br>
So, if nestable multi-line-comments have less problems than
non-nestable multi-line-comments from a usability POV (which I think is
the case), then I'd opt for nestable multi-line-comments.<br>
<br>
<br>
Regarding single-line-comments:<br>
<ol>
<li>Each single-line-comment can be emulated by exactly one
multi-line comments, but you cannot emulate each multi-line-comments by
exactly one single-line-comment. Thus, multi-line-comments are more
generic. Thus, having multi-line-comments actually satisfies people who
want to comment only one line, and thus provides "comparably more
satisfaction" than single-line-comments.<br>
</li>
<li>Furthermore, if you view a CTM document as a stream of
characters, the questions are just about which
"comment-start-sequence", which "comment-end-sequence". For
single-line-comments, the "comment-end-sequence" is, by definition,
also a "line-end-sequence". However, the "line-end-sequence" has a
meaning for the user which is entirely orthogonal to the meaning of
being a "comment-end-sequence" (namely, the meaning is representing an
end of a line). The good principle of Separation of Concerns (known
already by Dijkstra) gives us a "strong hint" to not have one sequence
with two separate meanings. (Actually, not having one string of bytes
with two separate meanings is quite important principle in Topic Maps,
isn't it?) It is just unclear for me why to not allow
line-end-sequences within comments.<br>
</li>
</ol>
<br>
ciao,<br>
Xuân.<br>
<br>
</body>
</html>