On 7/16/07, <b class="gmail_sendername">Jason Orendorff</b> &lt;<a href="mailto:jason.orendorff@gmail.com">jason.orendorff@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ben Simon wrote:<br>&gt; Now, what about a higher level case - something like I originally<br>&gt; mentioned.&nbsp;&nbsp;You go to open a DB connection, and it fails. Is the raise<br>&gt; continuable or not?&nbsp;&nbsp;I&#39;m not trying to be difficult here, I&#39;m honestly not
<br>&gt; sure which type it should be.<br><br>The author of the open-db procedure has to decide.<br>...[useful explanation trimmed]<br>When you read code, (raise) and (raise-continuable) will mean different<br>things.&nbsp;&nbsp;(raise) never returns.&nbsp;&nbsp;(raise-continuable) behaves more like an
<br>ordinary procedure: you write your code as though it will return, though<br>it might not.&nbsp;&nbsp;This communicative purpose alone is convincing to me.<br></blockquote></div><br>OK, I think I got it. Thanks Jason and Thomas for walking me through this.
<br><br>In the end, after a night of sleep, I think my own example provides a clear argument for why we need raise vs. raise-continuable.<br><br>[for the sake of it being in this thread, here&#39;s the example:]<br><span style="font-family: courier new,monospace;">
(define (open-db-connection host port username password)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; (let ((raw-tcp-conn (open-tcp-connection host port)))
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; (if (not raw-tcp-conn)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (raise &quot;Unable to open db connection&quot;)) ;; coming back here, useless</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; (authenticate-connection raw-tcp-conn username password)))
</span><br style="font-family: courier new,monospace;">&nbsp;<br><br>As Jason eluded to, the way I wrote the above cod&nbsp; returning from the handler wouldn&#39;t actually do any good as raw-tcp-conn would remain #f. I would have needed to specifically written the code to make returning back to the raise point meaningful.&nbsp; So, if I&#39;m going to write fancy code to support continuing the computation, then the least I can do is mark that code clearly with a raise-continuable vs raise procedure call.
<br><br>It&#39;s official, I&#39;m a believer.<br><br>-Ben<br><br>-- <br>Ben Simon<br>My blog: <a href="http://benjisimon.blogspot.com">http://benjisimon.blogspot.com</a><br><a href="http://tenspotting.com">tenspotting.com
</a> - Top 10 Lists++