From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6925C7F614 for ; Wed, 14 Sep 2016 14:51:23 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=tom.j.ridge@googlemail.com; spf=Pass smtp.mailfrom=tom.j.ridge@googlemail.com; spf=None smtp.helo=postmaster@mail-yw0-f182.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.161.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.161.182 as permitted sender) identity=mailfrom; client-ip=209.85.161.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yw0-f182.google.com) identity=helo; client-ip=209.85.161.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-yw0-f182.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AQJMdNBf7sVXzPmgHuHan9wb7lGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc66ZB7h7PlgxGXEQZ/co6odzbGH6ua/AydduN7B6ClEK8McEUddyI?= =?us-ascii?q?0/pE8JPo2sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7Mhdp?= =?us-ascii?q?dKyuQtaBx5f/6+fn15TNYgkArT65erRqNF3ioR/Y888bnpBKL6stwwDVq3BLPe?= =?us-ascii?q?9RwDU7C0iUmkPA4cL4xp9v/CkY7+4m8ohCF7/7c6s1DrhZFygOPGcy68nmsBDC?= =?us-ascii?q?SU2E4X5KATZeqQZBHwWQtEKyZZz2qCav7uc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DEAABVR9lXhrahVdFdGwEBAQMBAQEJA?= =?us-ascii?q?QEBFwEBBAEBCgEBgw8BAQEBAYFxB40sqyWCHAGHTAc4FAEBAQEBAQEBAQEBEgE?= =?us-ascii?q?BAQgLCwkZL4IyGIIXAQEBAwEBAg8RHQE4AQMBCwEFBQQHAwoqAgIiEgEFARwGE?= =?us-ascii?q?xoIiA0BAw8IogmBMj4yiz2ESQWDbwoZJw2DKQwBHAIGEIpwh0KCWgWUFYVTj1S?= =?us-ascii?q?BboRgiRSMW4I5Ex6BER6BX4FJgXg7NIZUAQEB?= X-IPAS-Result: =?us-ascii?q?A0DEAABVR9lXhrahVdFdGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?Bgw8BAQEBAYFxB40sqyWCHAGHTAc4FAEBAQEBAQEBAQEBEgEBAQgLCwkZL4IyG?= =?us-ascii?q?IIXAQEBAwEBAg8RHQE4AQMBCwEFBQQHAwoqAgIiEgEFARwGExoIiA0BAw8Iogm?= =?us-ascii?q?BMj4yiz2ESQWDbwoZJw2DKQwBHAIGEIpwh0KCWgWUFYVTj1SBboRgiRSMW4I5E?= =?us-ascii?q?x6BER6BX4FJgXg7NIZUAQEB?= X-IronPort-AV: E=Sophos;i="5.30,333,1470693600"; d="scan'208,217";a="236436231" Received: from mail-yw0-f182.google.com ([209.85.161.182]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 14 Sep 2016 14:51:21 +0200 Received: by mail-yw0-f182.google.com with SMTP id t67so14205311ywg.3 for ; Wed, 14 Sep 2016 05:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=q282Ddn1uuItUAxW5TUjmNBZ94nxtNSbKoAoNwxNkqA=; b=bUy0ip1f9t55HYDUlSeBP8h8bNRo/TskqKfay07I4eLDT1dPkBRnCdSZ8B2jM4bmzH ibptIGqGQVpiOiwTkT1srtdKONl4I61LgoRMl/uDEioZ4+mNCU5yWc8DKqRCjEdaxdbI 7ZoY1n6qAJEQ+WGF+7/h1DZaPQ+UK9Jk1orfHiKsEjzbBnGiBJwp4wJ9Vh2hy1GsbbZ/ u9mT9250k2iyOB8AU/LYlgsXN5pee0tEufjthih33OqqrJk0hYXzEAoW88Da7CScvX9B rPH7tyaBG0ZVvEFk7XyrRiAE3tEga7I8NV5HtsgGe/ZZBH64qrTqgN67m+Ao/mTZUmx6 rKIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=q282Ddn1uuItUAxW5TUjmNBZ94nxtNSbKoAoNwxNkqA=; b=efynWCm0Mpzrm/QZsdp7odBSl6sV2ILS0pHvt3wDhI2d3adtCZfcaYPxgzAJzfVgfo QuV9IMTA3zuzqDP0TGXr9cXkLKVeqHVJUKyrYNlBoWEe5Rwwn/0se5DYUs4trLi1jaiI kQt7xPPgXF8Yzh9iRGX+EpaPFD+8cTRupLJBfqTOLGv01AHxPH0noilAXlUrzcuioIbI TySy3kOcVsigXyQ71gXa0v35SZC+UBayvuHuNyxYrOk1z8T2sF1AFEHG9Lgs4xnscfkl eMMjPI2eSBiIPHe1YTqkHJvfPoo7gIFhU3uIb3a6YF7LWlC9xisqXSIgwtU6bHu5blvN 3oog== X-Gm-Message-State: AE9vXwPtjypmcyNtQSs0oV0zYokdQqNxV4ZKzSvFcDGdGXcwf/Xty31WNpBBwFUgnkjN5YTMVYA5cd4Q43tvWw== X-Received: by 10.129.14.213 with SMTP id 204mr2412721ywo.317.1473857480584; Wed, 14 Sep 2016 05:51:20 -0700 (PDT) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.103.41.130 with HTTP; Wed, 14 Sep 2016 05:51:00 -0700 (PDT) In-Reply-To: References: From: Tom Ridge Date: Wed, 14 Sep 2016 13:51:00 +0100 X-Google-Sender-Auth: jR1ag3kiUKbue-fj8a-ZGHADlUk Message-ID: To: David Allsopp Cc: caml-list Content-Type: multipart/alternative; boundary=001a1142e21e948a1f053c772fe2 Subject: Re: [Caml-list] Comment syntax? --001a1142e21e948a1f053c772fe2 Content-Type: text/plain; charset=UTF-8 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 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 > > --001a1142e21e948a1f053c772fe2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Isn't this rather complicated?=C2=A0

In this case, has there been any progress on "single line" comm= ents eg=C2=A0

// some comment

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

It seems to me= that multiline comments are a poor design choice. Single line comments per= mit 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 toke= n "//" to the end-of-line, no messing with string literals etc) s= ingle line comments?

Thanks



On 14 September 2016 at 13:38, David Allsopp <dra-news@metastack.co= m> 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 t= o match. Weird as that can seem at first encounter, it permits arbitrary co= mmenting out of blocks of code, which is quite useful...


David


--001a1142e21e948a1f053c772fe2--