[uim-commit] r1715 - branches/r5rs/sigscheme/test

yamaken at freedesktop.org yamaken at freedesktop.org
Fri Sep 30 17:25:35 PDT 2005


Author: yamaken
Date: 2005-09-30 17:25:32 -0700 (Fri, 30 Sep 2005)
New Revision: 1715

Modified:
   branches/r5rs/sigscheme/test/test-tail-rec.scm
Log:
* sigscheme/test/test-tail-rec.scm
  - (rec-call-with-values): New procedure
  - Add new test "proper tail recursion by call-with-values"


Modified: branches/r5rs/sigscheme/test/test-tail-rec.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-tail-rec.scm	2005-10-01 00:08:03 UTC (rev 1714)
+++ branches/r5rs/sigscheme/test/test-tail-rec.scm	2005-10-01 00:25:32 UTC (rev 1715)
@@ -671,6 +671,15 @@
          (lambda (cont)
            (rec-continuation (- n 1)))))))
 
+(define rec-call-with-values
+  (lambda (n)
+    (if (zero? n)
+	'succeeded
+        (call-with-values
+            (lambda () (values 2 3 n))
+          (lambda (dummy1 dummy2 n)
+            (rec-call-with-values (- n 1)))))))
+
 (define rec-proper-infinite
   (lambda (cnt)
     (rec-proper-infinite (+ cnt 1))))
@@ -958,6 +967,10 @@
 ;;               'succeeded
 ;;               (rec-continuation explosive-count))
 
+;; call-with-values
+(assert-equal? "proper tail recursion by call-with-values"
+               'succeeded
+               (rec-call-with-values explosive-count))
 
 ;; This test is succeeded if [OK]-exploded message sequence has been
 ;; printed as follows.



More information about the uim-commit mailing list