caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Tom Ridge <tom.j.ridge+list@googlemail.com>
To: David Allsopp <dra-news@metastack.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Comment syntax?
Date: Wed, 14 Sep 2016 13:51:00 +0100	[thread overview]
Message-ID: <CABooLwOu_xA+ubyUGVQOOGz1fey0=JRCAFK=Y5Bo3mt1zN1eSg@mail.gmail.com> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D901351A128F@Remus.metastack.local>

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

Isn't this rather complicated?

In this case, has there been any progress on "single line" comments eg

// some comment

? I think this was mentioned recently on the list. (I am also aware that //
is verboten for some reason).

It seems to me that multiline comments are a poor design choice. Single
line comments permit commenting arbitrary blocks (just prepend each line
with "//"), and play well with nested comments (no problem if a line starts
"// //" etc). Also, they are very simple to implement in the lexer.

Please can we have support for simple (ie from the token "//" to the
end-of-line, no messing with string literals etc) single line comments?

Thanks



On 14 September 2016 at 13:38, David Allsopp <dra-news@metastack.com> wrote:

> Tom Ridge wrote:
> > My opam install of ocaml 4.03.1 seems to compile the following:
> >
> > (* " *)
> > is this ml?
> > (* " *)
> >
> > Presumably the parser thinks the comment extends from l.1 to l.3
>
> Correct.
>
> > Is this intended?
>
> Yes - string literals are parsed in comments. Brackets, quotes, etc. need
> to match. Weird as that can seem at first encounter, it permits arbitrary
> commenting out of blocks of code, which is quite useful...
>
>
> David
>
>

[-- Attachment #2: Type: text/html, Size: 1904 bytes --]

  reply	other threads:[~2016-09-14 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 12:34 Tom Ridge
2016-09-14 12:38 ` David Allsopp
2016-09-14 12:51   ` Tom Ridge [this message]
2016-09-14 13:04     ` Jeremy Yallop
2016-09-14 13:11     ` David Allsopp

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='CABooLwOu_xA+ubyUGVQOOGz1fey0=JRCAFK=Y5Bo3mt1zN1eSg@mail.gmail.com' \
    --to=tom.j.ridge+list@googlemail.com \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.com \
    /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).