[uim-commit] r1437 - in branches/r5rs/sigscheme: . test

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Sep 6 05:46:22 PDT 2005


Author: yamaken
Date: 2005-09-06 05:46:19 -0700 (Tue, 06 Sep 2005)
New Revision: 1437

Modified:
   branches/r5rs/sigscheme/operations.c
   branches/r5rs/sigscheme/test/test-list.scm
Log:
* sigscheme/operations.c
  - (ScmOp_list_ref): Cosmetic change
* sigscheme/test/test-list.scm
  - (test list-tail): Replace equal? with eq? to test true validness


Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2005-09-06 12:31:16 UTC (rev 1436)
+++ branches/r5rs/sigscheme/operations.c	2005-09-06 12:46:19 UTC (rev 1437)
@@ -1067,17 +1067,17 @@
 
 ScmObj ScmOp_list_ref(ScmObj list, ScmObj scm_k)
 {
-    ScmObj list_tail = SCM_NULL;
+    ScmObj tail = SCM_NULL;
 
     if (FALSEP(ScmOp_numberp(scm_k)))
         SigScm_ErrorObj("list-ref : int required but got ", scm_k);
 
-    list_tail = ScmOp_listtail_internal(list, SCM_INT_VALUE(scm_k));
-    if (EQ(list_tail, SCM_INVALID) || NULLP(list_tail))
+    tail = ScmOp_listtail_internal(list, SCM_INT_VALUE(scm_k));
+    if (EQ(tail, SCM_INVALID) || NULLP(tail))
         SigScm_ErrorObj("list-ref : out of range or bad list, arglist is: ",
                         CONS(list, scm_k));
 
-    return CAR(list_tail);
+    return CAR(tail);
 }
 
 ScmObj ScmOp_memq(ScmObj obj, ScmObj list)

Modified: branches/r5rs/sigscheme/test/test-list.scm
===================================================================
--- branches/r5rs/sigscheme/test/test-list.scm	2005-09-06 12:31:16 UTC (rev 1436)
+++ branches/r5rs/sigscheme/test/test-list.scm	2005-09-06 12:46:19 UTC (rev 1437)
@@ -37,7 +37,8 @@
 (define elm1 (lambda () #f))
 (define elm2 (lambda () #f))
 (define elm3 (lambda () #f))
-(define cdr3 (cons elm3 ()))
+(define nil  ())
+(define cdr3 (cons elm3 nil))
 (define cdr2 (cons elm2 cdr3))
 (define cdr1 (cons elm1 cdr2))
 (define cdr0 (cons elm0 cdr1))
@@ -116,11 +117,11 @@
 ;;(assert-error  "list-tail test5" '() (list-tail '(a b c) 4))
 (assert-equal? "list-tail test6" '() (list-tail '() 0))
 ;;(assert-error  "list-tail test7" (list-tail '() 1))
-(assert-equal? "list-tail test8"  cdr0 (list-tail lst 0))
-(assert-equal? "list-tail test9"  cdr1 (list-tail lst 1))
-(assert-equal? "list-tail test10" cdr2 (list-tail lst 2))
-(assert-equal? "list-tail test11" cdr3 (list-tail lst 3))
-(assert-equal? "list-tail test12" '() (list-tail lst 4))
+(assert-eq?    "list-tail test8"  cdr0 (list-tail lst 0))
+(assert-eq?    "list-tail test9"  cdr1 (list-tail lst 1))
+(assert-eq?    "list-tail test10" cdr2 (list-tail lst 2))
+(assert-eq?    "list-tail test11" cdr3 (list-tail lst 3))
+(assert-eq?    "list-tail test12" nil  (list-tail lst 4))
 ;;(assert-error  "list-tail test13" (list-tail lst 5))
 
 ; list-ref



More information about the uim-commit mailing list