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

yamaken at freedesktop.org yamaken at freedesktop.org
Sat Oct 1 01:24:01 PDT 2005


Author: yamaken
Date: 2005-10-01 01:23:58 -0700 (Sat, 01 Oct 2005)
New Revision: 1732

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


Modified: branches/r5rs/sigscheme/test/test-tail-rec.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-tail-rec.scm	2005-10-01 08:17:34 UTC (rev 1731)
+++ branches/r5rs/sigscheme/test/test-tail-rec.scm	2005-10-01 08:23:58 UTC (rev 1732)
@@ -680,6 +680,13 @@
           (lambda (dummy1 dummy2 n)
             (rec-call-with-values (- n 1)))))))
 
+(define rec-receive
+  (lambda (n)
+    (if (zero? n)
+	'succeeded
+        (receive (dummy1 dummy2 n) (values 2 3 n)
+          (rec-receive (- n 1))))))
+
 (define rec-proper-infinite
   (lambda (cnt)
     (rec-proper-infinite (+ cnt 1))))
@@ -972,6 +979,11 @@
                'succeeded
                (rec-call-with-values explosive-count))
 
+;; receive
+(assert-equal? "proper tail recursion by receive"
+               'succeeded
+               (rec-receive explosive-count))
+
 ;; This test is succeeded if [OK]-exploded message sequence has been
 ;; printed as follows.
 ;;



More information about the uim-commit mailing list