[uim-commit] r1296 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Aug 24 00:26:22 PDT 2005


Author: yamaken
Date: 2005-08-24 00:26:20 -0700 (Wed, 24 Aug 2005)
New Revision: 1296

Modified:
   branches/r5rs/sigscheme/operations.c
Log:
* sigscheme/operations.c
  - (ScmOp_eqvp): Simplify the character type case
  - (ScmOp_equalp):
    * Ditto
    * Fix invalid equality semantics for closure and
      continuation. Having same members does not ensure equality
    * Comment out excessive equality check for port and value-packet
      which does not make sense


Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2005-08-24 04:42:03 UTC (rev 1295)
+++ branches/r5rs/sigscheme/operations.c	2005-08-24 07:26:20 UTC (rev 1296)
@@ -92,8 +92,7 @@
 
     case ScmChar:
         /* chars and are the same character according to the char=? */
-        if (NFALSEP(ScmOp_char_equal(obj1, obj2))) return SCM_TRUE;
-        break;
+        return ScmOp_char_equal(obj1, obj2);
 
     case ScmSymbol:  /* equivalent symbols must already be true on eq? */
     case ScmCons:
@@ -147,8 +146,7 @@
 
     case ScmChar:
         /* chars and are the same character according to the char=? */
-        if (NFALSEP(ScmOp_char_equal(obj1, obj2))) return SCM_TRUE;
-        break;
+        return ScmOp_char_equal(obj1, obj2);
 
     case ScmCons:
         for (; !NULLP(obj1); obj1 = CDR(obj1), obj2 = CDR(obj2)) {
@@ -188,7 +186,8 @@
             return SCM_TRUE;
         break;
 
-    case ScmSymbol: /* equivalent symbols must already be true on EQ */
+    case ScmSymbol:
+        /* equivalent symbols must already be true on the prior EQ */
         break;
 
     case ScmFunc:
@@ -197,25 +196,34 @@
         break;
 
     case ScmClosure:
-        if (EQ(SCM_CLOSURE_EXP(obj1), SCM_CLOSURE_EXP(obj2))
-            && EQ(SCM_CLOSURE_ENV(obj1), SCM_CLOSURE_ENV(obj2)))
-            return SCM_TRUE;
+        /*
+         * eq? is the valid equality check for closures. Having same members
+         * does not ensure equality.
+         */
         break;
 
     case ScmPort:
+#if 0
+        /* does not make sense. eq? is sufficient */
         if (EQ(SCM_PORT_PORTDIRECTION(obj1), SCM_PORT_PORTDIRECTION(obj2))
             && EQ(SCM_PORT_PORTINFO(obj1), SCM_PORT_PORTINFO(obj2)))
             return SCM_TRUE;
+#endif
         break;
 
     case ScmContinuation:
-        if (EQ(SCM_CONTINUATION_CONTINFO(obj1), SCM_CONTINUATION_CONTINFO(obj2)))
-            return SCM_TRUE;
+        /*
+         * eq? is the valid equality check for continuations. Having same
+         * members does not ensure equality.
+         */
         break;
 
     case ScmValuePacket:
+#if 0
+        /* does not make sense. eq? is sufficient */
         if (EQ(SCM_VALUEPACKET_VALUES(obj1), SCM_VALUEPACKET_VALUES(obj2)))
             return SCM_TRUE;
+#endif
         break;
 
     case ScmEtc:



More information about the uim-commit mailing list