PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 5(define (=~ a b)
 6  (< (abs (- a b)) 1e-8))
 7
 8;; Check first method
 9(check (=~ (foo 1 2 "bar" 4) 15))
10
11;; Check second method
12(check (=~ (foo 1 2) 4811.4))
13(check (=~ (foo 1 2 3.2) 4797.2))
14(check (=~ (foo 1 2 3.2 #\Q) 4798.2))
15
16(exit 0)