caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: <caml-list@inria.fr>
Subject: Re: [Caml-list] single-line comment request
Date: Tue, 8 Apr 2003 21:26:09 +0200	[thread overview]
Message-ID: <16019.8785.629.951518@hector.lesours> (raw)
In-Reply-To: <200304082129.38145.snob@snob.spb.ru>

>>>>> "Nickolay" == Nickolay Semyonov-Kolchin <snob@snob.spb.ru> 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: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
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


  reply	other threads:[~2003-04-08 19:26 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-08 12:56 Nickolay Semyonov-Kolchin
2003-04-08 15:17 ` Samuel Lacas
2003-04-08 14:27   ` Nickolay Semyonov-Kolchin
2003-04-08 16:21     ` Samuel Lacas
2003-04-09 15:15   ` Thierry SALSET
2003-04-08 15:19 ` Brian Hurt
2003-04-08 14:25   ` Nickolay Semyonov-Kolchin
2003-04-08 16:08     ` Brian Hurt
2003-04-08 15:38       ` Nickolay Semyonov-Kolchin
2003-04-08 17:42         ` Brian Hurt
2003-04-08 17:31     ` Chris Hecker
2003-04-08 16:29       ` Nickolay Semyonov-Kolchin
2003-04-08 19:26         ` Basile STARYNKEVITCH [this message]
2003-04-08 20:22           ` Brian Hurt
2003-04-08 21:37             ` Michal Moskal
2003-04-08 17:13       ` Brian Hurt
2003-04-08 19:23         ` Chris Hecker
2003-04-08 18:49           ` Karl Zilles
2003-04-08 19:04           ` Brian Hurt
2003-04-08 21:57             ` Daniel Andor
2003-04-08 22:07               ` Michal Moskal
2003-04-08 22:09               ` Brian Hurt
2003-04-10  2:59                 ` cashin
2003-04-10  7:58                   ` [Caml-list] { ... } vs ( ... ) vs begin ... end Frederic van der Plancke
2003-04-08 19:42           ` [Caml-list] single-line comment request Daniel M. Albro
2003-04-08 18:53             ` Alexander V. Voinov
2003-04-08 18:19               ` Nickolay Semyonov-Kolchin
2003-04-08 22:40             ` Joshua Scholar
2003-04-13 19:46             ` Andreas Rossberg
2003-04-13 22:57               ` Daniel M. Albro
2003-04-08 19:53           ` Jeff Henrikson
2003-04-08 20:31             ` Brian Hurt
2003-04-13 14:07     ` John Max Skaller
2003-04-08 15:28 ` Damien
2003-04-08 14:49   ` Nickolay Semyonov-Kolchin
2003-04-08 15:39   ` Brian Hurt
2003-04-08 15:45   ` malc
2003-04-08 15:45   ` Samuel Lacas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16019.8785.629.951518@hector.lesours \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).