<?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="2003/12/c9c38da4d98cb927dc5e77c8fe1605c9"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-12-03T14:01:41"
  subject="Re: [Caml-list] Question"
  prev="2003/12/8abc1f7c2b77ec2aef30c62eae064c13"
  next="2003/12/bd06ee9099e75c3d3e1ca4d8b3a79021"
  prev-in-thread="2003/12/928ebdb82757524a715d3934786a2a64"
  next-in-thread="2003/12/3f8a533bf7e11400eeb0d02ff50c1716"
  prev-thread="2003/12/cf645abf5fbb4bfeb95e8a52ae1ca918"
  next-thread="2003/12/50bb73b39cc484fbbec77b6fee08aa8d"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Question">
<msg 
  url="2003/12/035f1d364ebb8d8bd82cfe75d186759a"
  from="sebastien FURIC &lt;sebastien.furic@t...&gt;"
  author="sebastien FURIC"
  date="2003-12-01T15:43:11"
  subject="[Caml-list] Question">
<msg 
  url="2003/12/e78561a3930717ed85eecf809e6dfd38"
  from="Remi Vanicat &lt;vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-12-01T17:48:10"
  subject="Re: [Caml-list] Question">
<msg 
  url="2003/12/928ebdb82757524a715d3934786a2a64"
  from="sebastien FURIC &lt;sebastien.furic@t...&gt;"
  author="sebastien FURIC"
  date="2003-12-01T18:06:41"
  subject="Re: [Caml-list] Question">
</msg>
</msg>
<msg 
  url="2003/12/c9c38da4d98cb927dc5e77c8fe1605c9"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-12-03T14:01:41"
  subject="Re: [Caml-list] Question">
</msg>
<msg 
  url="2003/12/3f8a533bf7e11400eeb0d02ff50c1716"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-12-10T10:28:02"
  subject="Re: [Caml-list] Question">
<msg 
  url="2003/12/1e676f8fcefbaa708f890932f7547f19"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-12-10T16:54:10"
  subject="Re: [Caml-list] Question">
<msg 
  url="2003/12/562803867fd4a377b41a8e3a465f43b7"
  from="Luc Maranget &lt;luc.maranget@i...&gt;"
  author="Luc Maranget"
  date="2003-12-11T09:52:48"
  subject="Re: [Caml-list] Question">
<msg 
  url="2003/12/00762880f710a47d94d59f5f9e80641e"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-12-11T15:20:30"
  subject="Re: [Caml-list] Question">
<msg 
  url="2003/12/aecf296ada293906c355ef91f393e249"
  from="Luc Maranget &lt;luc.maranget@i...&gt;"
  author="Luc Maranget"
  date="2003-12-11T16:56:07"
  subject="Re: [Caml-list] Question">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Monday, December 1, 2003, at 04:41 PM, sebastien FURIC wrote:

&gt; # let test t t' = match t, t' with
&gt;   | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0
&gt; -&gt; "OK"
&gt;   | _ -&gt; "KO";;
&gt; Characters 73-79:
&gt; Warning: this pattern is unused.
&gt;   | ((Toto _ | Titi _), Toto x | Toto x, (Toto _ | Titi _)) when x = 0
&gt; -&gt; "OK"
&gt;                                           ^^^^^^
[...]

&gt;  I was expecting "when" to be right distributive over "|".

That notion doesn't make sense because "when" is not a pattern operator.
If you "distribute" when over |, you get this:

  # let test t t' = match t, t' with
    | ((Toto _ | Titi _), Toto x when x = 0
       | Toto x, (Toto _ | Titi _) when x = 0)
      -&gt; "OK"
    | _ -&gt; "KO";;

which is nonsense, from O'Caml's point of view.

-- Damien

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

