Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (let ((x (read)))
- (try (try (throw "cannot divide by zero")
- catch
- (lambda (exn)
- (cond ((= 0 (caddr x))
- (display exn)
- (newline)))
- (throw "No fractions allowed")))
- catch
- (lambda (exn)
- (cond ((not (integer? (/ (cadr x) (caddr x)))) (display exn)
- (newline))
- (else (display (/ (cadr x) (caddr x))))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement