/trunk/Examples/test-suite/schemerunme/overload_complicated.scm

# · Lisp · 16 lines · 10 code · 4 blank · 2 comment · 0 complexity · caf1f0bb46ff3bf8b7f3c91e5885ed04 MD5 · raw file

  1. (define-macro (check form)
  2. `(if (not ,form)
  3. (error "Check failed: " ',form)))
  4. (define (=~ a b)
  5. (< (abs (- a b)) 1e-8))
  6. ;; Check first method
  7. (check (=~ (foo 1 2 "bar" 4) 15))
  8. ;; Check second method
  9. (check (=~ (foo 1 2) 4811.4))
  10. (check (=~ (foo 1 2 3.2) 4797.2))
  11. (check (=~ (foo 1 2 3.2 #\Q) 4798.2))
  12. (exit 0)