PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Lisp | 19 lines | 13 code | 5 blank | 1 comment | 0 complexity | 06d7c85854d008dc7f8d8f1cc733bf29 MD5 | raw file
 1;;;; Automatic test of multiple return values
 2
 3(let ((quotient/remainder (divide-l 37 5)))
 4  (if (not (equal? quotient/remainder '(7 2)))
 5      (exit 1)))
 6
 7(let ((quotient-remainder-vector (divide-v 41 7)))
 8  (if (not (equal? quotient-remainder-vector #(5 6)))
 9      (exit 1)))
10
11(call-with-values (lambda ()
12		    (divide-mv 91 13))
13		  (lambda (quotient remainder)
14		    (if (not (and (= quotient 7)
15				  (= remainder 0)))
16			(exit 1))))
17
18(exit 0)
19