caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolás Ojeda Bär" <nicolas.ojeda.bar@lexifi.com>
To: Ian Zimmerman <itz@very.loosely.org>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] How to use ocaml.warning
Date: Fri, 26 Jul 2019 15:55:24 +0000	[thread overview]
Message-ID: <CADK7aFM2UOvyC402nHTvczLL9o-fZi1XeBenzk1jObcx1fGywA@mail.gmail.com> (raw)
In-Reply-To: <20190726155237.pnzqneafrpsbssrt@matica.foolinux.mooo.com>

Hi Ian,

On Fri, Jul 26, 2019 at 5:53 PM Ian Zimmerman <itz@very.loosely.org> wrote:
>
> On 2019-07-26 04:37, Nicolás Ojeda Bär wrote:
>
> > In this case, you would want to attach the warning to the "let" binding:
> >
> >     let[@warning "-8"] (i, j) :: rest = l in ...
> >
> > Equivalently, you can use a postfix form:
> >
> >     let (i, j) :: rest = l [@@warning "-8"] in ...
> >
> > You can also attach the attribute to the whole "let" expression:
> >
> >     (let (i, j) :: rest = l in ...) [@warning "-8"]
> >
> > In this case, the warning is also disabled in the body of the "let"
> > expression.
> >
> > Going one step further, you can disable the warning on a whole section
> > of a file by using a "floating" form of the attribute:
> >
> >     [@@@warning "-8"]
> >     ...
> >
> > In this case, the warning will be disabled for any item appearing
> > after the attribute.
>
> Thanks.  But the manual says "ocaml.warning", not "warning".  What am I
> misunderstanding?

Actually both names are recognized. The long name ocaml.warning is to
be preferred when there is danger of shadowing (say, by a ppx
preprocessor).

Best wishes,
--
Nicolás OJEDA BÄR
nicolas.ojeda.bar@lexifi.com
https://www.lexifi.com

> --
> Please don't Cc: me privately on mailing lists and Usenet,
> if you also post the followup to the list or newsgroup.
> To reply privately _only_ on Usenet and on broken lists
> which rewrite From, fetch the TXT record for no-use.mooo.com.

      reply	other threads:[~2019-07-26 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26  2:14 Ian Zimmerman
2019-07-26  4:37 ` Nicolás Ojeda Bär
2019-07-26 15:52   ` Ian Zimmerman
2019-07-26 15:55     ` Nicolás Ojeda Bär [this message]

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=CADK7aFM2UOvyC402nHTvczLL9o-fZi1XeBenzk1jObcx1fGywA@mail.gmail.com \
    --to=nicolas.ojeda.bar@lexifi.com \
    --cc=caml-list@inria.fr \
    --cc=itz@very.loosely.org \
    /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).