[sc34wg3] Comments on comments

Lars Marius Garshol larsga at garshol.priv.no
Tue Jan 29 06:10:36 EST 2008


* Jaeho Lee
>
> The above proposal using "#" is eye-pleasing to me too. However, I  
> wonder how well it fits with, for example,
> <http://www.jtc1sc34.org/repository/0935.htm#dir-mergemap> URL with  
> "#" in it.
>
> It may be correctly parsed by a smart parser, [...]

There's no difficulty in parsing this. There's been a lot of comments  
like this one, wondering whether we can use character X to mean  
something specific when character X can also occur in some kind of  
token, but there's no problem with this.

For example, "isa" is now a defined keyword, meaning that it occurs as  
a non-terminal in the grammar. Nobody has suggested that this clashes  
with identifiers, which might easily contain the same string ("lisa",  
"pisa", "misa", etc etc), because we all know it wouldn't. The  
situation with the '#' character is no different. Lexers will have no  
difficulty distinguishing a '#' in a URI from a '#' on its own.

> but I would like to see correct coloring in my editor that has very  
> simple rule for comments, not distinguishing "# in URL" and "# for  
> comments".

You use Emacs, Jaeho. :-)

In any case I'm not really clear on what you favour. Do you prefer the  
'#' syntax, or the '!' one?

> For you information, X-Window (I am still using it actively)  
> configuration files use "!" for comments.


Yep. Algol 60, too.

--Lars M.


More information about the sc34wg3 mailing list