(define (define-error location message . condition) (let ((base (make-property-condition 'exn 'location location 'message message)) (extra (apply make-property-condition condition))) (make-composite-condition base extra))) (define (sxml-error data location) (define-error location "invalid sxml" 'sxml 'data data)) (for-each (lambda (x) (condition-case (if (even? x) (sxml-error "foo" 'foo) (print x)) ((exn sxml) (print 42)))) '(1 2 3)) ;; the above prints 1 and 3, not 1, 42 and 3, why?