<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Dec 8, 2009 at 1:25 AM, Ben Franksen <span dir="ltr">&lt;<a href="mailto:ben.franksen@online.de">ben.franksen@online.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Michael Snoyman wrote:<br>
&gt; On Mon, Dec 7, 2009 at 9:53 PM, Henning Thielemann &lt;<br>
&gt; <a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>&gt; wrote:<br>
&gt;&gt; On Mon, 7 Dec 2009, Michael Snoyman wrote:<br>
</div><div class="im">&gt;&gt; I also think that in an earlier mail I answered, that errors can leave<br>
&gt;&gt; you with corrupt data, say invalid file handles, memory pointers, or data<br>
&gt;&gt; structures that violate invariants. You won&#39;t like to close files from<br>
&gt;&gt; invalid file handles and free memory from corrupt pointers or run into<br>
&gt;&gt; infinite loops by traversing the corrupt data structures. That&#39;s the<br>
&gt;&gt; reason why it is better to stop execution of the program and hand over<br>
&gt;&gt; control to the next higher level, say the shell or the web browser, that<br>
&gt;&gt; can free resources safely.<br>
&gt;&gt;<br>
&gt; Firstly: I&#39;m really referring exclusively to non-FFI Haskell programs, to<br>
&gt; which most of the issues you mention don&#39;t really apply. Nonetheless, I<br>
&gt; think that for a language with exceptions, it still makes sense to use the<br>
&gt; exceptions in these cases.<br>
&gt;<br>
&gt; In all these cases, I think the correct thing is to have a specific<br>
&gt; exception type that is thrown that signals that it is such an<br>
&gt; unrecoverable error. This allows the programmer to do *whatever* they<br>
&gt; want. Perhaps they want to save some other data to a file before exiting?<br>
&gt; Perhaps they want to spawn a process to send in a bug report? Who knows.<br>
&gt; It doesn&#39;t matter. The point is, the user *might* want to do something,<br>
&gt; and exceptions let them do it if they wish, or they can completely ignore<br>
&gt; that specific exception type and let the program crash anyway.<br>
<br>
</div>Michael, Henning<br>
<br>
There are two meanings to the word &#39;exception&#39; in this context; both of you<br>
tend to conflate these different meanings. One meaning is about a<br>
*mechanism* for non-local control flow; the other is about certain classes<br>
of un-desired program conditions.<br>
<br></blockquote><div>Actually, I think you&#39;ll find the we are *not* conflating the terms. Henning makes it clear later on.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Michael, you are above arguing that it is ok to use the same /mechanism/ to<br>
signal errors and exceptions. That is ok with me. There are certainly good<br>
use cases, you have presented a few. However, that does not mean it<br>
is &#39;silly&#39; or &#39;unnecessary&#39; to distinguish between program(-mer) errors and<br>
other kinds of expected exceptional conditions in general, as you claimed<br>
in a previous message.<br>
<br>
I agree with Henning insofar as I think it is important to make the<br>
*conceptual* distinction -- regardless of whether we use the same mechanism<br>
to signal (and, perhaps, after serious consideration, handle) them.<br>
<br>
So, maybe it would help if we could agree to use different terms for those<br>
two meanings of the word &#39;exception&#39;. I think &#39;exception&#39; is too strongly<br>
associated with the non-local control flow mechanism to introduce a new<br>
word for it.<br>
<br>
Henning, what about calling an undesired  but expected condition a &#39;failure&#39;<br>
instead of an exception, so we could reserve this word for the language<br>
mechanism? Calling something a &#39;failure&#39; in this sense (i.e. in contrast<br>
to &#39;error&#39;) would always include some judgement, as it needs to take the<br>
different program levels into account.<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div>Please do *not* call them failures; a few of us have been working on a failure package and associated helper packages, and called it failure specifically because it was an unused term and thus incurred none of the wrath which rains down upon those unfortunate souls who conflate the terms error and exception in the descriptions of their issues.<br>
 <br></div>Michael<br></div></div>