[sc34wg3] Comments on comments

Xuân Baldauf xuan--2008.01--sc34wg3--isotopicmaps.org at baldauf.org
Tue Jan 22 18:02:28 EST 2008


Lars Marius Garshol wrote:
> I think we can summarize the debate so far as follows:
>   - we need both single-line and multi-line comments,
>   - there's a general preference for nestable multi-line comments.
>
> Xuan is right that nestable comments mean CTM is no longer a regular  
> language, and as far as I can recall this is the only thing that goes  
> beyond that boundary. I don't think this really matters, though.
>   
Yes, especially as CTM as specified in the drafts so has not been
parseable by common regular expression parsers, either.. ;-)
> There's nothing like a consensus on *what* syntax to use though. We  
> have the following proposals:
>
> N0935:
>    (: multiline comment :)
>    # single-line comment
>
> Kyoto proposal:
>    !( multiline comment )!
>    ! single-line comment
>
> My proposal:
>    #( multiline comment )# or (# multiline comment #)
>    # single-line comment
>    *and* change item identifier cryptic delimiter from '#' to '!'
>
> Personally, I much favour my own proposal.
Of course. ;-)

To disseminate my POV on this:

I prefer '#' for single-line comments over '!', because '#' this is so
widely used (i.e. Bash, Perl, Python, Ruby) and '!' has a usual meaning
of "important", "emphasis", "force" or "attention", which is not
adequate for comments. '!' visually obstructs what is really more
important, i.e. the non-commented parts of the document. That
non-commented parts of documents are generally regarded to be more
important than commented parts of documents can be concluded from
various syntax highlighting definitions which often assign a color to
comment expressions which has a lower-than-average contrast against the
background color. One example for this are the syntax-highlighted
sourcecode examples in http://en.wikipedia.org/wiki/Perl .

I really do not care about the exact syntax of multiline-comments. 
However, I would prefer something which could be typed quickly on
standard keyboards (like "/*" as well as "*/" can by typed by using the
2 adjacent keys on the numpad above '8' and '9'. However, I'm aware that
"/*" and "*/" may be just too meaningful in TMQL to be a general comment
syntax for all handwritten topic map languages.).

> The single-line comment  
> syntax is very widely used, and has the added advantage of forcing us  
> to use something else for item identifiers (my proposal there is '!',  
> or even not supporting it, but I don't really care).
>
> --Lars M.
>   
By the way, having comments nestable in TMQL as well as in CTM actually
does the right thing if there is a (same-syntax) comment in some
TMQL-embedded CTM fragment and this part of the TMQL expression
(containing the whole CTM fragment) is also to be commented out. So I
get to like the idea of nestable comments even more.


ciao,
Xuân. :-)




More information about the sc34wg3 mailing list