From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA19163; Tue, 8 Apr 2003 19:09:32 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA19064 for ; Tue, 8 Apr 2003 19:09:31 +0200 (MET DST) Received: from epexch01.qlogic.org ([63.170.40.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h38H9T927330 for ; Tue, 8 Apr 2003 19:09:30 +0200 (MET DST) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Tue, 8 Apr 2003 12:09:42 -0500 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Tue, 8 Apr 2003 12:09:42 -0500 Date: Tue, 8 Apr 2003 12:13:02 -0500 (CDT) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Chris Hecker cc: Nickolay Semyonov-Kolchin , Brian Hurt , Subject: Re: [Caml-list] single-line comment request In-Reply-To: <4.3.2.7.2.20030408091635.037a29b0@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 08 Apr 2003 17:09:42.0477 (UTC) FILETIME=[A576D7D0:01C2FDF1] X-Spam: no; 0.00; qlogic:01 caml-list:01 hecker:01 noticeably:01 uncomment:01 commenting:01 trickery:01 camlp:01 slows:01 compiles:01 multiline:01 3.07:01 3.06:01 3.06,:01 bytecomp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 8 Apr 2003, Chris Hecker wrote: > > >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 Not noticeably in my experience. > (no need to > count {[()]} to see where the comment ends, This is only relevent if you're parsing the file. If you are parsing the file, I'm assuming you have at least regular expressions, if not a full on lex/yacc combination. So counting fences isn't that big of a problem. Vim's syntax highlighting seems to work just fine (well, except for *really* long comments). > rectangular editing commands > can comment and uncomment blocks, Adding (* before the block and *) after is so difficult? > end of line is sometimes ragged so > commenting out cannot be done linearly without editor macro trickery, Hmm. I wouldn't have called finding the end of a line 'editor macro trickery'. In vi, it's just $. Or, from anywhere in line, hit 'A' and automatically append to the end of the line. In emacs, C-E jumps you to the end of the line, IIRC. > wasted characters and movement for single line comments (which I would > assume are the majority of comments by number, if not by lines), Three. Space, asterix, close paren. > etc.). Also, using camlp4 for this slows down compiles. All of the above might be an argument for doing single-line comments *instead of* multiline comments. Let me just get some plutonium for the Delorean and we can go back to 1985 and change that design decision. Now: here's a counter argument to adding single line comments: backwards compatibility. While Ocaml-3.07 may support single line comments, Ocaml-3.06 doesn't, and by definition never will. So code with single line comments will never run on Ocaml-3.06, despite the fact that except for single line comments, there is no other compatibility problems. And there are reasons to still be using older versions of Ocaml- Jocaml being one of them. I'm not opposed to breaking backwards compatibility- I just want something valuable in return. > 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. Or just check out page 91 of the language standard. > > 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. Um, that it's not hard to write single-line comments without a special single line comment delimiter? Brian ------------------- 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