<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/dcfa3c89152151c40d42837f02268c1e"
  from="Frédéric_van_der_Plancke &lt;fvdp@d...&gt;"
  author="Frédéric_van_der_Plancke"
  date="2009-01-28T18:29:49"
  subject="Re: [Caml-list] Warning wished"
  prev="2009/01/4e3033b888ae0f626c14906f241d690a"
  next="2009/01/ef7464a63d1602015e62b2b986211645"
  prev-in-thread="2009/01/ee440040904926febe34eb8fd7af3f0c"
  next-in-thread="2009/01/f5569cbcdc3e54b49c67f5f1b64a0812"
  prev-thread="2009/01/ec5abc48403b5e7647c7a58e6fcf15a5"
  next-thread="2009/01/4e3033b888ae0f626c14906f241d690a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Warning wished">
<msg 
  url="2009/01/7bbb57f36284fe4ff07085af2e385261"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T13:52:48"
  subject="Warning wished">
<msg 
  url="2009/01/aea937f8b99b3256c78e9bc52e2c299e"
  from="Matthieu Wipliez &lt;mwipliez@y...&gt;"
  author="Matthieu Wipliez"
  date="2009-01-28T14:07:23"
  subject="Re : [Caml-list] Warning wished">
<msg 
  url="2009/01/35bc1c0863a6ee8290aadf88f8fe0ae7"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T14:23:13"
  subject="Re: Re : [Caml-list] Warning wished">
<msg 
  url="2009/01/4ec57fa817e7ef6cf9c31bb4deed5536"
  from="Nicolas Pouillard &lt;nicolas.pouillard@g...&gt;"
  author="Nicolas Pouillard"
  date="2009-01-28T20:57:16"
  subject="Re: Re : [Caml-list] Warning wished">
</msg>
</msg>
</msg>
<msg 
  url="2009/01/6d74997bb1fe66bddfac5a3b8d983d78"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T14:10:31"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/45953a20270735445c964bb67f8ea92e"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T14:27:15"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/ee440040904926febe34eb8fd7af3f0c"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T14:44:23"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/dcfa3c89152151c40d42837f02268c1e"
  from="Frédéric_van_der_Plancke &lt;fvdp@d...&gt;"
  author="Frédéric_van_der_Plancke"
  date="2009-01-28T18:29:49"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/f5569cbcdc3e54b49c67f5f1b64a0812"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T19:08:40"
  subject="Re: [Caml-list] Warning wished">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/01/5b1dcaf779bdc8831935101571c8421d"
  from="Martin Jambon &lt;martin.jambon@e...&gt;"
  author="Martin Jambon"
  date="2009-01-28T16:57:12"
  subject="Re: [Caml-list] Warning wished">
</msg>
</msg>
</thread>

<contents>
Dmitri Boulytchev wrote:
&gt;
&gt;&gt; Applying g to 1 you will definitely have f x of type int and you have to
&gt;&gt; take care of the returned integer. Unfortunatly caml emits no warning in
&gt;&gt; this case (even if I understand why) :(.
&gt;&gt;   
&gt;    Sure :) But as far as I understand this warning means "this 
&gt; non-unit value will definitely be omitted, and this
&gt; can be possibly wrong". Under this interpretation the compiler has to 
&gt; ensure undoubtedly that the value is
&gt; always non-unit.
&gt;    BTW you may (temporarily) change your code into something like
&gt;
&gt;    let f x = [x]
&gt;
&gt;    of even into
&gt;
&gt;    let f x = object method get = x end
&gt;
&gt;    and find all the suspicious places :)
&gt;
&gt;    Best regards,
&gt;    Dmitri.
There's the question of what the compiler _does_, what the compiler 
_could_ do and what the compiler _should_ do.

I don't think "this 'a could be unit" is a good reason for skipping the 
warning. On the contrary, "this 'a will probably sometimes be a real 
value" seems a sufficient reason to add a warning. If needed, the 
programmer can easily suppress the warning by adding "ignore" or adding 
a ": unit" type constraint (whichever applies).

(Remains to see whether adding the warning to OCaml is worth the manwork.)

Frédéric

</contents>

</message>

