* srfi/srfi-1.c (srfi1_ilength), libguile/list.c (scm_ilength,
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 21 Apr 2003 01:59:57 +0000 (01:59 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 21 Apr 2003 01:59:57 +0000 (01:59 +0000)
scm_last_pair), libguile/unif.c (l2ra): Prefer !SCM_CONSP over
SCM_NCONSP.

* libguile/unif.c (l2ra): Eliminate redundant check.

Now, guile itself does not include any calls to SCM_NCONSP any
more.

libguile/ChangeLog
libguile/list.c
libguile/unif.c
srfi/ChangeLog
srfi/srfi-1.c

index ee0d688..4e02b5c 100644 (file)
@@ -1,3 +1,11 @@
+2003-04-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * list.c (scm_ilength, scm_last_pair), unif.c (l2ra):Prefer
+       !SCM_CONSP over SCM_NCONSP.  Now, guile itself does not include
+       any calls to SCM_NCONSP any more.
+
+       * unif.c (l2ra): Eliminate redundant check.
+
 2003-04-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
 
        * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
index a081f09..f1552c5 100644 (file)
@@ -171,11 +171,11 @@ scm_ilength(SCM sx)
 
   do {
     if (SCM_NULL_OR_NIL_P(hare)) return i;
-    if (SCM_NCONSP(hare)) return -1;
+    if (!SCM_CONSP (hare)) return -1;
     hare = SCM_CDR(hare);
     i++;
     if (SCM_NULL_OR_NIL_P(hare)) return i;
-    if (SCM_NCONSP(hare)) return -1;
+    if (!SCM_CONSP (hare)) return -1;
     hare = SCM_CDR(hare);
     i++;
     /* For every two steps the hare takes, the tortoise takes one.  */
@@ -292,10 +292,10 @@ SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
   SCM_VALIDATE_CONS (SCM_ARG1, lst);
   do {
     SCM ahead = SCM_CDR(hare);
-    if (SCM_NCONSP(ahead)) return hare;
+    if (!SCM_CONSP (ahead)) return hare;
     hare = ahead;
     ahead = SCM_CDR(hare);
-    if (SCM_NCONSP(ahead)) return hare;
+    if (!SCM_CONSP (ahead)) return hare;
     hare = ahead;
     tortoise = SCM_CDR(tortoise);
   }
index 79e16a0..8b77b4a 100644 (file)
@@ -2215,7 +2215,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k)
     {
       while (n--)
        {
-         if (SCM_IMP (lst) || SCM_NCONSP (lst))
+         if (!SCM_CONSP (lst))
            return 0;
          ok = ok && l2ra (SCM_CAR (lst), ra, base, k + 1);
          base += inc;
@@ -2228,7 +2228,7 @@ l2ra (SCM lst, SCM ra, unsigned long base, unsigned long k)
     {
       while (n--)
        {
-         if (SCM_IMP (lst) || SCM_NCONSP (lst))
+         if (!SCM_CONSP (lst))
            return 0;
          scm_array_set_x (SCM_ARRAY_V (ra), SCM_CAR (lst), SCM_MAKINUM (base));
          base += inc;
index 8477203..45453da 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * srfi-1.c (srfi1_ilength): Prefer !SCM_CONSP over SCM_NCONSP.
+       Now, guile itself does not include any calls to SCM_NCONSP any
+       more.
+
 2003-04-05  Marius Vollmer  <mvo@zagadka.de>
 
         * Changed license terms to the plain LGPL thru-out.
index 8444154..dc97102 100644 (file)
@@ -38,11 +38,11 @@ srfi1_ilength (SCM sx)
 
   do {
     if (SCM_NULL_OR_NIL_P(hare)) return i;
-    if (SCM_NCONSP(hare)) return -2;
+    if (!SCM_CONSP (hare)) return -2;
     hare = SCM_CDR(hare);
     i++;
     if (SCM_NULL_OR_NIL_P(hare)) return i;
-    if (SCM_NCONSP(hare)) return -2;
+    if (!SCM_CONSP (hare)) return -2;
     hare = SCM_CDR(hare);
     i++;
     /* For every two steps the hare takes, the tortoise takes one.  */