Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: Tom Ridge <tom.j.ridge+list@googlemail.com>,
	caml-list <caml-list@inria.fr>
Subject: RE: [Caml-list] Comment syntax?
Date: Wed, 14 Sep 2016 12:38:19 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D901351A128F@Remus.metastack.local> (raw)
In-Reply-To: <CABooLwMFHWSfkTT1+eqOSh-mh=OAiWiFjRouB8HL5W=M2Y=xcg@mail.gmail.com>

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


  reply	other threads:[~2016-09-14 12:38 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 [this message]
2016-09-14 12:51   ` Tom Ridge
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=E51C5B015DBD1348A1D85763337FB6D901351A128F@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@inria.fr \
    --cc=tom.j.ridge+list@googlemail.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