PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Lisp | 19 lines | 13 code | 5 blank | 1 comment | 0 complexity | 06d7c85854d008dc7f8d8f1cc733bf29 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. ;;;; Automatic test of multiple return values
  2. (let ((quotient/remainder (divide-l 37 5)))
  3. (if (not (equal? quotient/remainder '(7 2)))
  4. (exit 1)))
  5. (let ((quotient-remainder-vector (divide-v 41 7)))
  6. (if (not (equal? quotient-remainder-vector #(5 6)))
  7. (exit 1)))
  8. (call-with-values (lambda ()
  9. (divide-mv 91 13))
  10. (lambda (quotient remainder)
  11. (if (not (and (= quotient 7)
  12. (= remainder 0)))
  13. (exit 1))))
  14. (exit 0)