caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Suppress warning from within Ocaml source file
@ 2015-11-12  8:49 Soegtrop, Michael
  2015-11-12  9:10 ` Gabriel Scherer
  2015-11-12 12:21 ` Mr. Herr
  0 siblings, 2 replies; 17+ messages in thread
From: Soegtrop, Michael @ 2015-11-12  8:49 UTC (permalink / raw)
  To: caml users

Dear OCaml users,

Is there a way to suppress warnings from inside an Ocaml  source file? I know I can do this from the ocamlc command line, but I want to suppress the warning only in specific cases and I think I should put a comment on why something is suppressed. From my C background I am used to #pragma warning and find it quite convenient.

The specific warning I want to suppress is Warning 23: "all the fields are explicitly listed in this record: the 'with' clause is useless". I have a case where I might want to extend a record in the future and if I do so the with clause most likely would make sense, so I want to keep the with clause, even though it is superfluous right now.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  8:49 [Caml-list] Suppress warning from within Ocaml source file Soegtrop, Michael
@ 2015-11-12  9:10 ` Gabriel Scherer
  2015-11-12  9:33   ` Soegtrop, Michael
  2015-11-12  9:49   ` Daniel Bünzli
  2015-11-12 12:21 ` Mr. Herr
  1 sibling, 2 replies; 17+ messages in thread
From: Gabriel Scherer @ 2015-11-12  9:10 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml users

You can use the "warning" or "ocaml.warning" annotation:

  { foo with ... }[@warning "-23"]

but:
- it only works with OCaml 4.02.x and later
- the fact that we have to use the warning number for now does not
make for very readable code

I would agree this warning is of debatable value: warnings should
pressure us to make our code *more* robust to extension by adding new
fields/variants, not *less*.

On Thu, Nov 12, 2015 at 9:49 AM, Soegtrop, Michael
<michael.soegtrop@intel.com> wrote:
> Dear OCaml users,
>
> Is there a way to suppress warnings from inside an Ocaml  source file? I know I can do this from the ocamlc command line, but I want to suppress the warning only in specific cases and I think I should put a comment on why something is suppressed. From my C background I am used to #pragma warning and find it quite convenient.
>
> The specific warning I want to suppress is Warning 23: "all the fields are explicitly listed in this record: the 'with' clause is useless". I have a case where I might want to extend a record in the future and if I do so the with clause most likely would make sense, so I want to keep the with clause, even though it is superfluous right now.
>
> Best regards,
>
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  9:10 ` Gabriel Scherer
@ 2015-11-12  9:33   ` Soegtrop, Michael
  2015-11-12  9:44     ` Gabriel Scherer
  2015-11-12  9:49   ` Daniel Bünzli
  1 sibling, 1 reply; 17+ messages in thread
From: Soegtrop, Michael @ 2015-11-12  9:33 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: caml users

Dear Gabriel,

> I would agree this warning is of debatable value: warnings should pressure us
> to make our code *more* robust to extension by adding new fields/variants,
> not *less*.

I take your advice and simply disable this warning for all source files.

Just I wonder why I have to call ocamlbuild with -cflag -g -cflag -w -cflag -23. From the ocamlbuild documentation I would expect that -cflag -g,-w,-23 should also work, but it results in a usage info.

Best regards,

Michael 
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  9:33   ` Soegtrop, Michael
@ 2015-11-12  9:44     ` Gabriel Scherer
  2015-11-12  9:57       ` Soegtrop, Michael
  0 siblings, 1 reply; 17+ messages in thread
From: Gabriel Scherer @ 2015-11-12  9:44 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml users

You can just use the tag
    warn(-23)

It is documented for example in
  https://github.com/gasche/manual-ocamlbuild/blob/master/manual.md#tags-basics



On Thu, Nov 12, 2015 at 10:33 AM, Soegtrop, Michael
<michael.soegtrop@intel.com> wrote:
> Dear Gabriel,
>
>> I would agree this warning is of debatable value: warnings should pressure us
>> to make our code *more* robust to extension by adding new fields/variants,
>> not *less*.
>
> I take your advice and simply disable this warning for all source files.
>
> Just I wonder why I have to call ocamlbuild with -cflag -g -cflag -w -cflag -23. From the ocamlbuild documentation I would expect that -cflag -g,-w,-23 should also work, but it results in a usage info.
>
> Best regards,
>
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  9:10 ` Gabriel Scherer
  2015-11-12  9:33   ` Soegtrop, Michael
@ 2015-11-12  9:49   ` Daniel Bünzli
  1 sibling, 0 replies; 17+ messages in thread
From: Daniel Bünzli @ 2015-11-12  9:49 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Soegtrop, Michael, caml users



Le jeudi, 12 novembre 2015 à 09:10, Gabriel Scherer a écrit :

> I would agree this warning is of debatable value: warnings should
> pressure us to make our code *more* robust to extension by adding new
> fields/variants, not *less*.

FWIW I also find this warning very dubious, see  

  http://caml.inria.fr/mantis/view.php?id=6179

apparently others do not, for reasons that are unknown to me.  

Best,  

Daniel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  9:44     ` Gabriel Scherer
@ 2015-11-12  9:57       ` Soegtrop, Michael
  0 siblings, 0 replies; 17+ messages in thread
From: Soegtrop, Michael @ 2015-11-12  9:57 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: caml users

Dear Gabriel,

> You can just use the tag
>     warn(-23)

perfect thanks! The _tags file concept is still something I need to get used to ...

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12  8:49 [Caml-list] Suppress warning from within Ocaml source file Soegtrop, Michael
  2015-11-12  9:10 ` Gabriel Scherer
@ 2015-11-12 12:21 ` Mr. Herr
  2015-11-12 13:02   ` Soegtrop, Michael
  2015-11-12 13:48   ` Daniel Bünzli
  1 sibling, 2 replies; 17+ messages in thread
From: Mr. Herr @ 2015-11-12 12:21 UTC (permalink / raw)
  To: caml-list



On 12.11.2015 09:49, Soegtrop, Michael wrote:
> Dear OCaml users,
>
> Is there a way to suppress warnings from inside an Ocaml  source file? I know I can do this from the ocamlc command line, but I want to suppress the warning only in specific cases and I think I should put a comment on why something is suppressed. From my C background I am used to #pragma warning and find it quite convenient.
>
> The specific warning I want to suppress is Warning 23: "all the fields are explicitly listed in this record: the 'with' clause is useless". I have a case where I might want to extend a record in the future and if I do so the with clause most likely would make sense, so I want to keep the with clause, even though it is superfluous right now.
On the other hand:

it is quite possible that your  with-construct is more harmful than useful:

when extending the record, the compiler will not flag the lines in your code you have
to check.

/Str.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 12:21 ` Mr. Herr
@ 2015-11-12 13:02   ` Soegtrop, Michael
  2015-11-12 13:48   ` Daniel Bünzli
  1 sibling, 0 replies; 17+ messages in thread
From: Soegtrop, Michael @ 2015-11-12 13:02 UTC (permalink / raw)
  To: Mr. Herr, caml-list

Dear Mr. Herr,

> it is quite possible that your  with-construct is more harmful than useful:
> 
> when extending the record, the compiler will not flag the lines in your code
> you have to check.

Indeed true, thanks for pointing this out. Maybe I was too quick with disabling the warning 23 altogether and I should better use the }[@warning "-23"] syntax.

In this specific case though it won't be a problem, because it is a function which by design modifies only a specific field of the record (let's call it a setter function) and the record right now has only this one field but is likely to grow.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 12:21 ` Mr. Herr
  2015-11-12 13:02   ` Soegtrop, Michael
@ 2015-11-12 13:48   ` Daniel Bünzli
  2015-11-12 14:54     ` Soegtrop, Michael
  1 sibling, 1 reply; 17+ messages in thread
From: Daniel Bünzli @ 2015-11-12 13:48 UTC (permalink / raw)
  To: Mr. Herr; +Cc: caml-list

Le jeudi, 12 novembre 2015 à 12:21, Mr. Herr a écrit :
> On the other hand:
>  
> it is quite possible that your with-construct is more harmful than useful:
>  
> when extending the record, the compiler will not flag the lines in your code you have
> to check.


That still doesn't answer why this warning exists at all. Of course depending on context you should or should not use `with` according to the kind of type-checking you want when you evolve your code base.

But the purpose of the `with` construct is precisely that you do not have to list all the other fields which is quite natural for functional record updates. Besides the kind of code evolution Michael mentions is also quite natural and thus I don't see why the compiler should complain if you happen to mention all the fields in the with construct.  

Nobody provided me with a good answer to the question: why is this a problem and I should be warned about this ? The only answer I got (cf PR 6179) was "we receive many complaints about warnings so just turn it off".

Daniel





^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 13:48   ` Daniel Bünzli
@ 2015-11-12 14:54     ` Soegtrop, Michael
  2015-11-12 15:14       ` Daniel Bünzli
  0 siblings, 1 reply; 17+ messages in thread
From: Soegtrop, Michael @ 2015-11-12 14:54 UTC (permalink / raw)
  To: Daniel Bünzli, Mr. Herr; +Cc: caml-list

Dear Daniel,

> That still doesn't answer why this warning exists at all. Of course depending
> on context you should or should not use `with` according to the kind of type-
> checking you want when you evolve your code base.

as far as I understood the point is that it is questionable if using with at all in such situations is a good idea. If with is not used and new fields are added, the compiler will warn about missing fields. Depending on the situation this might be more helpful, because even if you have a with, it might be that you still have to add new fields later, which is hidden by the with.

So one can argue that the point of this warning is that if a with already does provide some fields "automatically" it is useful, but if the with doesn't really do anything you might be better of without the with and the warnings you get when you extend the record.

I would say both views are valid, and it is a matter of taste.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 14:54     ` Soegtrop, Michael
@ 2015-11-12 15:14       ` Daniel Bünzli
  2015-11-12 16:37         ` Leo White
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Bünzli @ 2015-11-12 15:14 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: Mr. Herr, caml-list



Le jeudi, 12 novembre 2015 à 14:54, Soegtrop, Michael a écrit :

> as far as I understood the point is that it is questionable if using with at all in such situations is a good idea. If with is not used and new fields are added, the compiler will warn about missing fields.  

If with is not used it will not *warn*: your program won't compile.
  
> So one can argue that the point of this warning is that if a with already does provide some fields "automatically" it is useful, but if the with doesn't really do anything you might be better of without the with and the warnings you get when you extend the record.

This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.  

Daniel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 15:14       ` Daniel Bünzli
@ 2015-11-12 16:37         ` Leo White
  2015-11-12 17:26           ` Daniel Bünzli
  0 siblings, 1 reply; 17+ messages in thread
From: Leo White @ 2015-11-12 16:37 UTC (permalink / raw)
  To: caml-list

> This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.  

I don't particularly wish to argue for or against using this warning, but I think it is worth noting
that this is not really any different from:

  # type t = Foo | Bar;;
  type t = Foo | Bar

  # let f = function
    | Foo -> 1
    | Bar -> 2
    | _ -> 3;;
        Characters 47-48:
      | _ -> 3;;
        ^
  Warning 11: this match case is unused.
  val f : t -> int = <fun>

Regards,

Leo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 16:37         ` Leo White
@ 2015-11-12 17:26           ` Daniel Bünzli
  2015-11-12 18:39             ` Virgile Prevosto
  0 siblings, 1 reply; 17+ messages in thread
From: Daniel Bünzli @ 2015-11-12 17:26 UTC (permalink / raw)
  To: Leo White; +Cc: caml-list

Le jeudi, 12 novembre 2015 à 16:37, Leo White a écrit :
> > This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.  
>  
> I don't particularly wish to argue for or against using this warning, but I think it is worth noting
> that this is not really any different from:

[…]  

It's quite different: you have dead code in your example.

D



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 17:26           ` Daniel Bünzli
@ 2015-11-12 18:39             ` Virgile Prevosto
  2015-11-12 19:21               ` Gerd Stolpmann
  2015-11-12 19:34               ` Jeremy Yallop
  0 siblings, 2 replies; 17+ messages in thread
From: Virgile Prevosto @ 2015-11-12 18:39 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: Leo White, OCAML

2015-11-12 18:26 GMT+01:00 Daniel Bünzli <daniel.buenzli@erratique.ch>:
> Le jeudi, 12 novembre 2015 à 16:37, Leo White a écrit :
>> > This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.
>>
>> I don't particularly wish to argue for or against using this warning, but I think it is worth noting
>> that this is not really any different from:
>
> […]
>
> It's quite different: you have dead code in your example.
>

But in the record case, the expr in { expr with ... } will indeed be
evaluated (thus is not dead), but its result will never be used, which
is barely better. In the (admittedly contrived) example below,
investigating the cause of the warning would save you from a runtime
exception:

type foo = { a : int; }
let rec x = lazy { a = (Lazy.force x).a }
let y = { (Lazy.force x) with a = 42 }

Now that I think of it, it is more like warning 26, with the exception
that in the present case, the expression is usually a variable and
thus already evaluated.

Best regards,
-- 
E tutto per oggi, a la prossima volta
Virgile

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 18:39             ` Virgile Prevosto
@ 2015-11-12 19:21               ` Gerd Stolpmann
  2015-11-12 20:16                 ` Hendrik Boom
  2015-11-12 19:34               ` Jeremy Yallop
  1 sibling, 1 reply; 17+ messages in thread
From: Gerd Stolpmann @ 2015-11-12 19:21 UTC (permalink / raw)
  To: Virgile Prevosto; +Cc: Daniel Bünzli, Leo White, OCAML

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

Am Donnerstag, den 12.11.2015, 19:39 +0100 schrieb Virgile Prevosto:
> 2015-11-12 18:26 GMT+01:00 Daniel Bünzli <daniel.buenzli@erratique.ch>:
> > Le jeudi, 12 novembre 2015 à 16:37, Leo White a écrit :
> >> > This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.
> >>
> >> I don't particularly wish to argue for or against using this warning, but I think it is worth noting
> >> that this is not really any different from:
> >
> > […]
> >
> > It's quite different: you have dead code in your example.
> >
> 
> But in the record case, the expr in { expr with ... } will indeed be
> evaluated (thus is not dead), but its result will never be used, which
> is barely better. In the (admittedly contrived) example below,
> investigating the cause of the warning would save you from a runtime
> exception:
> 
> type foo = { a : int; }
> let rec x = lazy { a = (Lazy.force x).a }
> let y = { (Lazy.force x) with a = 42 }
> 
> Now that I think of it, it is more like warning 26, with the exception
> that in the present case, the expression is usually a variable and
> thus already evaluated.

Maybe print the warning only in the non-variable case? And rephrase the
warning to "the expression before 'with' is not evaluated"?

Gerd

> 
> Best regards,
> -- 
> E tutto per oggi, a la prossima volta
> Virgile
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 18:39             ` Virgile Prevosto
  2015-11-12 19:21               ` Gerd Stolpmann
@ 2015-11-12 19:34               ` Jeremy Yallop
  1 sibling, 0 replies; 17+ messages in thread
From: Jeremy Yallop @ 2015-11-12 19:34 UTC (permalink / raw)
  To: Virgile Prevosto; +Cc: Daniel Bünzli, Leo White, OCAML

On 12 November 2015 at 18:39, Virgile Prevosto <virgile.prevosto@m4x.org> wrote:
> But in the record case, the expr in { expr with ... } will indeed be
> evaluated (thus is not dead), but its result will never be used, which
> is barely better.

it's not just the result that's unused: the type of 'expr' isn't used
either when all the fields are specified:

   # {"one" with contents = 2};;
   Characters 0-25:
     {"one" with contents = 2};;
     ^^^^^^^^^^^^^^^^^^^^^^^^^
   Warning 23: all the fields are explicitly listed in this record:
   the 'with' clause is useless.
   - : int ref = {contents = 2}

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Suppress warning from within Ocaml source file
  2015-11-12 19:21               ` Gerd Stolpmann
@ 2015-11-12 20:16                 ` Hendrik Boom
  0 siblings, 0 replies; 17+ messages in thread
From: Hendrik Boom @ 2015-11-12 20:16 UTC (permalink / raw)
  To: caml-list

On Thu, Nov 12, 2015 at 08:21:46PM +0100, Gerd Stolpmann wrote:
> Am Donnerstag, den 12.11.2015, 19:39 +0100 schrieb Virgile Prevosto:
> > 2015-11-12 18:26 GMT+01:00 Daniel Bünzli <daniel.buenzli@erratique.ch>:
> > > Le jeudi, 12 novembre 2015 à 16:37, Leo White a écrit :
> > >> > This misses the point. By using `with` I can instruct the compiler that I don't want my program not to compile if I add or remove fields. In the current system I can do this with any update I want to make to a record except if for some strange reason that update happen to touch all the current fields of the record.
> > >>
> > >> I don't particularly wish to argue for or against using this warning, but I think it is worth noting
> > >> that this is not really any different from:
> > >
> > > […]
> > >
> > > It's quite different: you have dead code in your example.
> > >
> > 
> > But in the record case, the expr in { expr with ... } will indeed be
> > evaluated (thus is not dead), but its result will never be used, which
> > is barely better. In the (admittedly contrived) example below,
> > investigating the cause of the warning would save you from a runtime
> > exception:
> > 
> > type foo = { a : int; }
> > let rec x = lazy { a = (Lazy.force x).a }
> > let y = { (Lazy.force x) with a = 42 }
> > 
> > Now that I think of it, it is more like warning 26, with the exception
> > that in the present case, the expression is usually a variable and
> > thus already evaluated.
> 
> Maybe print the warning only in the non-variable case? And rephrase the
> warning to "the expression before 'with' is not evaluated"?

Isn't this message also misleading?  Isn't the expression evaluated even 
though its value ignored?  This could show up f it has side effects.  

-- hendr9ik


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-11-12 20:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12  8:49 [Caml-list] Suppress warning from within Ocaml source file Soegtrop, Michael
2015-11-12  9:10 ` Gabriel Scherer
2015-11-12  9:33   ` Soegtrop, Michael
2015-11-12  9:44     ` Gabriel Scherer
2015-11-12  9:57       ` Soegtrop, Michael
2015-11-12  9:49   ` Daniel Bünzli
2015-11-12 12:21 ` Mr. Herr
2015-11-12 13:02   ` Soegtrop, Michael
2015-11-12 13:48   ` Daniel Bünzli
2015-11-12 14:54     ` Soegtrop, Michael
2015-11-12 15:14       ` Daniel Bünzli
2015-11-12 16:37         ` Leo White
2015-11-12 17:26           ` Daniel Bünzli
2015-11-12 18:39             ` Virgile Prevosto
2015-11-12 19:21               ` Gerd Stolpmann
2015-11-12 20:16                 ` Hendrik Boom
2015-11-12 19:34               ` Jeremy Yallop

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).