www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Nested /* */ comments

reply Bruno Medeiros <daiphoenixNO SPAMlycos.com> writes:
Ok, this might be the most simple feature request ever, but here goes.
Why is it that the /* */ comments are not already nestable? Can it be 
done? It wouldn't even hurt C code porting, and might render /+ +/ 
useless, (or keep both comments so that /* */ and /+ +/ can be used for 
different types of commenting)

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Mar 04 2006
parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Bruno Medeiros wrote:
 Why is it that the /* */ comments are not already nestable? Can it be
 done? It wouldn't even hurt C code porting
It can be done, but it would hurt porting, which is probably why it's not been done. It's not that rare to see multiple "/*" relying on one "*/" to close them all. Were they made nesting, only the last would be closed and the code would break.
Mar 04 2006
parent Bruno Medeiros <daiphoenixNO SPAMlycos.com> writes:
Deewiant wrote:
 Bruno Medeiros wrote:
 Why is it that the /* */ comments are not already nestable? Can it be
 done? It wouldn't even hurt C code porting
It can be done, but it would hurt porting, which is probably why it's not been done. It's not that rare to see multiple "/*" relying on one "*/" to close them all. Were they made nesting, only the last would be closed and the code would break.
Hum, that's right, didn't remember about that case, although it seems like a bad practice to do that in C/C++ code. I still prefer that /* */ were nestable. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Mar 05 2006