;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "reader.ss" "plai" "lang") ; ; try { ; s = sum(L); ; System.out.println("After 1st assignment"); ; s = s + 1; ; } catch (Exception e) { ; System.out.print("Bad: "); ; System.out.println(e); ; } (define (sum values throw) (cond [(null? values) 0] [(number? (first values)) (+ (first values) (sum (rest values) throw))] [else (throw 'Not-a-number)])) (define s 0) (define L '(1 2 3 x 5)) (let ([e (call/cc (λ (throw) (set! s (sum L throw)) (display "After 1st assignment") (set! s (+ s 1)) ))]) (if (void? e) (void) ; Completed without error (begin (display "Bad: ") (display e))))