Browse thread
[Caml-list] single-line comment request
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Chris Hecker <checker@d...> |
| Subject: | Re: [Caml-list] single-line comment request |
>Again, this extension is purely stylish.
Actually, just to fuel the fire, it's not just stylish. Single-line
comments are sometimes easier to work with programmatically (no need to
count {[()]} to see where the comment ends, rectangular editing commands
can comment and uncomment blocks, end of line is sometimes ragged so
commenting out cannot be done linearly without editor macro trickery,
wasted characters and movement for single line comments (which I would
assume are the majority of comments by number, if not by lines),
etc.). Also, using camlp4 for this slows down compiles.
I don't think this is the most important feature ever, but it would be nice
for more than just stylistic reasons.
I would assume there are lots of two-character combinations that are
invalid and that don't hose cpp, like "(|" which is even a bit iconographic
for the task, in my opinion. Somebody better at compilers than me could
probably write a program to parse the .y and .l files and generate all
unused and invalid two-character combinations.
Hmm, I just did a quick test to check the assumption of whether single-line
comments are more common. In my code, 86% of comments are single line. In
the compiler bytecomp directory, 89% are single line. Make of that what
you will.
Chris
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners