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 VAA24552; Tue, 8 Apr 2003 21:26:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA24441 for ; Tue, 8 Apr 2003 21:26:11 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h38JQAX05881 for ; Tue, 8 Apr 2003 21:26:10 +0200 (MET DST) Received: from hector.lesours (lesours.starynkevitch.net [80.65.224.217]) by kraid.nerim.net (Postfix) with ESMTP id 371AF40F00 for ; Tue, 8 Apr 2003 21:26:08 +0200 (CEST) Received: from basile by hector.lesours with local (Exim 3.36 #1 (Debian)) id 192yjR-0003qq-00 for ; Tue, 08 Apr 2003 21:26:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <16019.8785.629.951518@hector.lesours> Date: Tue, 8 Apr 2003 21:26:09 +0200 To: Subject: Re: [Caml-list] single-line comment request In-Reply-To: <200304082129.38145.snob@snob.spb.ru> References: <4.3.2.7.2.20030408091635.037a29b0@localhost> <200304082129.38145.snob@snob.spb.ru> X-Mailer: VM 7.14 under Emacs 21.2.2 From: Basile STARYNKEVITCH X-Spam: no; 0.00; basile:01 caml-list:01 nickolay:01 snob:01 spb:01 hecker:01 clashes:01 azerty:01 char:01 execve:01 haskell:01 faiencerie:01 92340:01 reine:01 nerim:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Nickolay" == Nickolay Semyonov-Kolchin writes: Nickolay> On Tuesday 08 April 2003 22:31, Chris Hecker wrote: Chris>> Hmm, I just did a quick test to check the assumption of Chris>> whether single-line comments are more common. In my code, 86% Chris>> of comments are single line. [...] I also have many single line comments Nickolay> This is serious technical motivation to implement Nickolay> single-line comments in language. I agree, but will make a few remarks: adding single-line comment is trivial to do; for example, to add ## comments just add the following UNTESTED line to ocaml/lex/lexer.mll (after rule main = parse near line 90) "##" [ ^ '\n' '\r' ] + { main lexbuf } the problem is to agree for a lexing comment rule which won't break a lot of existing code. I have no idea if ## is not already used in some existing code somewhere. (And it is not definable as an infix operator). Of course, the problem is to avoid clashes with practical use of the infix operator syntax in Ocaml. perhaps we might agree on a triple character comment starter if a double character is not enough. Egoistically, as a user of a French AZERTY keyboard, I tend to dislike the # char since it require a double-keystroke (# is AltGr " on AZERTY keyboards). I also suggest the following di-graph for comments ## as suggested before #! (which is compatible with Unix first line execve convention) -- (which is like comments in Ada and Haskell) // (reminding of Java & C++) %% |* for the visual effect !! (old Basic had single ! for comment) For tri-graph starting line comments we could consider --- *** ||| /// -*- [*] I'm sorry for this posting (which is a bit silly or at least unimportant, as the whole thread). The major point is to reach an agreement; once we've got an agreement which don't break a lot of code implementing such one-line comments is a matter of minutes. (Of course, extending the Emacs & Vim mode for emacs is a bit harder). Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet aliases: basiletunesorg = bstarynknerimnet 8, rue de la Faïencerie, 92340 Bourg La Reine, France ------------------- 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