From 7da5786ef3bf963c2092c1407ab03251636cec2f Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 28 Jun 2014 20:46:04 +0900 Subject: [PATCH] unlock parameter tests --- t/r7rs-tests.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/t/r7rs-tests.scm b/t/r7rs-tests.scm index 2bdea07e..c31b3dfa 100644 --- a/t/r7rs-tests.scm +++ b/t/r7rs-tests.scm @@ -364,18 +364,18 @@ -;; (define radix -;; (make-parameter -;; 10 -;; (lambda (x) -;; (if (and (integer? x) (<= 2 x 16)) -;; x -;; (error "invalid radix"))))) -;; (define (f n) (number->string n (radix))) -;; (test "12" (f 12)) -;; (test "1100" (parameterize ((radix 2)) -;; (f 12))) -;; (test "12" (f 12)) +(define radix + (make-parameter + 10 + (lambda (x) + (if (and (integer? x) (<= 2 x 16)) + x + (error "invalid radix"))))) +(define (f n) (number->string n (radix))) +(test "12" (f 12)) +(test "1100" (parameterize ((radix 2)) + (f 12))) +(test "12" (f 12)) (test '(list 3 4) `(list ,(+ 1 2) 4)) (let ((name 'a)) (test '(list a (quote a)) `(list ,name ',name))) (test '(a 3 4 5 6 b) `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b))