a guest Dec 5th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (let ((x (read)))
  2.     (try (try (throw "cannot divide by zero")
  3.      catch
  4.      (lambda (exn)
  5.        (cond ((= 0 (caddr x))
  6.               (display exn)
  7.               (newline)))
  8.        (throw "No fractions allowed")))
  9.          catch
  10.          (lambda (exn)
  11.            (cond ((not (integer? (/ (cadr x) (caddr x)))) (display exn)
  12.                   (newline))
  13.                  (else (display (/ (cadr x) (caddr x))))))))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand