<?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/07/8d067f3472c9db2843900ad04bc1ddfd"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-28T18:43:41"
  subject="[Caml-list] assert caught by try with _"
  prev="2003/07/01ec52a086a48ba9f37cf34e09d2a702"
  next="2003/07/1b6ecd32d8cb08e0e226160a88d2418f"
  next-in-thread="2003/07/1b6ecd32d8cb08e0e226160a88d2418f"
  prev-thread="2003/07/976c83213750a167f0a635b7687ffe81"
  next-thread="2003/07/ba9f7a43c963a0693df6ce5d6c7736d4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] assert caught by try with _">
<msg 
  url="2003/07/8d067f3472c9db2843900ad04bc1ddfd"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-28T18:43:41"
  subject="[Caml-list] assert caught by try with _">
<msg 
  url="2003/07/1b6ecd32d8cb08e0e226160a88d2418f"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-07-28T19:08:22"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/07/da955a051fbb26778695027528f86f7b"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-29T02:37:13"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/07/012000871048c09c09b73acb0a767ec8"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-29T03:18:01"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/07/421e11339985a294563f9b4fc0d5a34d"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-07-29T21:01:52"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/08/cc45ea5e2dc634955ab812e1d6fdacd7"
  from="Michal Moskal &lt;malekith@p...&gt;"
  author="Michal Moskal"
  date="2003-08-06T12:21:08"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/08/4aebd5f287a4e3d4cc44215ead37efd7"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2003-08-06T14:50:26"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/08/89bd326adba5da59a781ac6d3ad19564"
  from="Michal Moskal &lt;malekith@p...&gt;"
  author="Michal Moskal"
  date="2003-08-06T17:45:16"
  subject="Re: [Caml-list] assert caught by try with _">
</msg>
</msg>
</msg>
<msg 
  url="2003/07/af414b82397383bcb6da895d2858c783"
  from="Yaron M. Minsky &lt;yminsky@c...&gt;"
  author="Yaron M. Minsky"
  date="2003-07-30T10:22:20"
  subject="Re: [Caml-list] assert caught by try with _">
<msg 
  url="2003/07/40d54eae7f4ed6f16eb41e07c5c59e83"
  from="james woodyatt &lt;jhw@w...&gt;"
  author="james woodyatt"
  date="2003-07-30T15:47:38"
  subject="Re: [Caml-list] assert caught by try with _">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/07/b7392a72f9fe176635fedc6a184d67e1"
  from="Jason Hickey &lt;jyh@c...&gt;"
  author="Jason Hickey"
  date="2003-07-30T05:45:03"
  subject="[Caml-list] unwind-protect">
<msg 
  url="2003/07/5ff669a9d2be35ec585b536e2e0fc7ca"
  from="Yaron M. Minsky &lt;yminsky@c...&gt;"
  author="Yaron M. Minsky"
  date="2003-07-30T10:30:23"
  subject="Re: [Caml-list] unwind-protect">
<msg 
  url="2003/07/85b8e032e5a714fc6c464715b482bb2c"
  from="Didier Remy &lt;Didier.Remy@i...&gt;"
  author="Didier Remy"
  date="2003-07-30T17:25:46"
  subject="Re: [Caml-list] unwind-protect">
<msg 
  url="2003/07/0ee85c5c688c958d4d9c57749ea69cb2"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-07-31T00:47:09"
  subject="Re: [Caml-list] unwind-protect">
</msg>
</msg>
</msg>
<msg 
  url="2003/07/bb20974642b0a6c34c428a093f2086a5"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2003-07-30T14:44:21"
  subject="Re: [Caml-list] unwind-protect">
</msg>
</msg>
<msg 
  url="2003/07/7321c1d7a6a5de7042a617ca2c897309"
  from="Jason Hickey &lt;jyh@c...&gt;"
  author="Jason Hickey"
  date="2003-07-30T05:44:09"
  subject="Re: [Caml-list] assert caught by try with _">
</msg>
</msg>
</thread>

<contents>

Is the the "right thing" for assert to be caught by a try ... with _ -&gt; ... 
block?  In other words, it seems like you want an assert to always blow up 
if asserts are turned on, not to fail silently when there's a try block 
somewhere higher up in the program.  Maybe it should be an option to have 
it fail immediately regardless of whether there's an exception handler 
around it?  The problem is that the workaround is to muck with every "with" 
expression to ensure you don't accidentally catch an assert, which is a 
huge pain and error prone, so it seems easier to have an option to just 
blow up.  The rationale is that asserts are meta, not part of the main 
program's flow.

I just got bitten by this and spent a couple hours trying to figure out why 
my program silently stopped working.

Thanks,
Chris

# let _ = try assert false with _ -&gt; ();;
- : unit = ()

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

