On 6/13/05, Michele Simionato <[EMAIL PROTECTED]> wrote:
> It looks like "handle-exception" cannot handles exceptions happening at macro
> expansion time:
> 
> (define-macro (raise-error bool)
>   (if (eq? #t bool)
>       (error "error inside macro!"))
>   #f)
> 
> (handle-exceptions exn (print "error caught")
>                    (raise-error #t))
> 
> The error is NOT caught. Is this the right behavior?

Yes, it's absolutely correct: the handle-exceptions clause
above is executed at *runtime*, the macro-expansion happens
at compile/macroexpansion-time.
To catch macroexpansion errors, try this:

(handle-exceptions ex ... (macroexpand '(raise-error #f)))

(in the interpreter)


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to