Ambiguous comment syntax

Rainer Deyke rainerd at eldwood.com
Sat Aug 8 18:26:48 PDT 2009


Oliver Hoog wrote:
> There is already the unambiguous /+...+/ syntax, so why not drop the
> /*...*/ syntax? Compatibility? Convenience? I think D should be more
> pragmatic.
> What do you think?

I don't think D needs two inline comment forms, but /+...+/ is no less
ambiguous than /*...*/.  Don't forget about the unary '+' operator:

auto p = 1;
auto j = 100/+p;

(Also, "multi-line"?  I only use /*...*/ for inline comments that end
before the end of the line.  I use multiple instances of '//' if I want
a comment that extends beyond the end of a line.)


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list