<div dir="ltr">Yes, I'd missed that distinction.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 3, 2013 at 12:55 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 2013-02-03, at 6:40 AM, Jason Felice <<a href="mailto:jason.m.felice@gmail.com">jason.m.felice@gmail.com</a>> wrote:<br>
<br>
> I think I'm seeing a gambit bug.<br>
><br>
> I have a situation where this returns #f:<br>
><br>
> (with-exception-handler<br>
>   (lambda (e) #t)<br>
>   (lambda () (trampoline-gp-set! (make-trampoline) 6 99) #f))<br>
><br>
> And this returns #t:<br>
><br>
> (with-exception-catcher<br>
>   (lambda (e) #t)<br>
>   (lambda () (trampoline-gp-set! (make-trampoline) 6 99) #f))<br>
><br>
> And running this from the repl raises:<br>
><br>
> (trampoline-gp-set! (make-trampoline) 6 99)<br>
><br>
> The definition of trampoline-gp-set! is currently:<br>
><br>
> (define trampoline-gp-set!/internal<br>
>   (c-lambda (trampoline int unsigned-int64)<br>
>           void<br>
>     "___arg1->gp[___arg2] = ___arg3;"))<br>
><br>
> (define (trampoline-gp-set! trampoline index value)<br>
>   (if (>= index 6)<br>
>     (raise "invalid index for trampoline-gp-set!"))<br>
>   (trampoline-gp-set!/internal trampoline index value))<br>
><br>
> But all this happens with this definition as well:<br>
><br>
> (define trampoline-gp-set!<br>
>   (c-lambda (trampoline int unsigned-int64)<br>
>           void<br>
> #<<END_OF_C_LAMBDA<br>
>   if (___arg2 >= 6)<br>
>     ___err = ___FIX(___UNKNOWN_ERR);<br>
>   else<br>
>     ___arg1->gp[___arg2] = ___arg3;<br>
> END_OF_C_LAMBDA<br>
> ))<br>
><br>
> Am I missing something?<br>
><br>
> I'm using WITH-EXCEPTION-HANDLER elsewhere to do the same thing and it appears to be working there.<br>
<br>
</div></div>Are you aware that with-exception-catcher unwinds the stack (similarly to a try/catch in other languages), but with-exception-handler does not (the result of the exception handler will be returned by the call to raise).<br>

<br>
Does that help explain the behavior you are seeing?<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc Feeley<br>
<br>
<br>
</font></span></blockquote></div><br></div>