<?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="2005/05/d2a9913d187b0e1218647ef4adfeeb96"
  from="Johann Spies &lt;jspies@s...&gt;"
  author="Johann Spies"
  date="2005-05-16T08:43:13"
  subject="Re: [Caml-list] question on exceptions"
  prev="2005/05/762915bddf4ffeafe2765647734a4809"
  next="2005/05/feb8580b4a6ba74f4723ffaffb2ed7da"
  prev-in-thread="2005/05/dd9819d3a2a504a8a319330b6d40b766"
  prev-thread="2005/05/6fb08219a82c0e404d154a7ba1b64914"
  next-thread="2005/05/4c6f9679e2048c3a128f2fd42dedaafb"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="question on exceptions">
<msg 
  url="2005/05/dd9819d3a2a504a8a319330b6d40b766"
  from="Julien Verlaguet &lt;Julien.Verlaguet@p...&gt;"
  author="Julien Verlaguet"
  date="2005-05-13T13:34:24"
  subject="question on exceptions">
<msg 
  url="2005/05/d2a9913d187b0e1218647ef4adfeeb96"
  from="Johann Spies &lt;jspies@s...&gt;"
  author="Johann Spies"
  date="2005-05-16T08:43:13"
  subject="Re: [Caml-list] question on exceptions">
</msg>
</msg>
</thread>

<contents>
On Fri, May 13, 2005 at 03:34:22PM +0200, Julien Verlaguet wrote:
&gt; I have the following peace of code
&gt; 
&gt; exception E;;
&gt; let x=E;;
&gt; exception E;;
&gt; 
&gt; I don't understand why the two following things are not equivalent :
&gt; 
&gt; # x=E;;
&gt; - : bool = true
&gt; 
&gt; # match x with
&gt;   | E -&gt; true
&gt;   | _ -&gt; false;;
&gt; - : bool = false
&gt; 
&gt; Is this normal ?

Maybe.  I am no expert but I suspect the second "exception E;;" causes
the behaviour that you saw.  Look at this:

# exception E;;
let x=E;;
exception E;;
exception E
# val x : exn = E
# exception E
#  x=E;;
- : bool = true
#  match x with
  | E -&gt; true
  | _ -&gt; false;;
    - : bool = false

So far it is the same, but

# exception E;;
exception E
# let x=E;;
val x : exn = E
#  x=E;;
- : bool = true
#  match x with
  | E -&gt; true
  | _ -&gt; false;;
    - : bool = true

Regards
Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "In my Father's house are many mansions: if it were not
      so, I would have told you. I go to prepare a place for
      you. And if I go and prepare a place for you, I will 
      come again, and receive you unto myself; that where I 
      am, there ye may be also."        John 14:2,3 

</contents>

</message>

