[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] How to turn off exception handlers in my code?

From: Matt Welland
Subject: [Chicken-users] How to turn off exception handlers in my code?
Date: Wed, 15 Mar 2017 13:05:10 -0700

I have many exception handlers, mostly handle-exceptions but some condition-case, and I'd like to run some tests and turn OFF the exception handling. I tried using a proc but that does not work:

(define (mt-faux-handle-exceptions exn alt . cmds)
  (let ((alt-proc (lambda ()
   (let ((exn exn))
    (apply lambda '() cmds)))

The exn variable is not seen by the alt code and a "Error: unbound variable: exn" message is issued.

I've tried a macro but I don't know enough to make it work. This starting point works:

(define-syntax common:handle-exceptions
   (syntax-rules ()
     ((_ exn-in errstmt ...)
      (handle-exceptions exn-in errstmt ...))))

But I run into trouble as soon as I try to replace the actual handle-exceptions with something else.

Is there any built-in switchable on/off exception handler or does someone have a macro they can share that does what I need or something similar?

Any help appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]