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

kzk at freedesktop.org kzk at freedesktop.org
Tue Dec 6 08:33:29 PST 2005


Author: kzk
Date: 2005-12-06 08:33:23 -0800 (Tue, 06 Dec 2005)
New Revision: 2397

Modified:
   branches/r5rs/sigscheme/storage.c
Log:
* sigscheme/storage.c
  - (Scm_Type): make efficient by using tag.
    BTW, we also need to hide the internal representation here?


Modified: branches/r5rs/sigscheme/storage.c
===================================================================
--- branches/r5rs/sigscheme/storage.c	2005-12-06 16:22:54 UTC (rev 2396)
+++ branches/r5rs/sigscheme/storage.c	2005-12-06 16:33:23 UTC (rev 2397)
@@ -322,34 +322,37 @@
 #if SCM_OBJ_COMPACT
 enum ScmObjType Scm_Type(ScmObj obj)
 {
-    if (CONSP(obj))
+    if (SCM_TAG_CONSP(obj)) {
         return ScmCons;
-    else if (INTP(obj))
-        return ScmInt;
-    else if (CHARP(obj))
-        return ScmChar;
-    else if (CLOSUREP(obj))
+    } else if (SCM_TAG_CLOSUREP(obj)) {
         return ScmClosure;
-    else if (SYMBOLP(obj))
-        return ScmSymbol;
-    else if (STRINGP(obj))
-        return ScmString;
-    else if (VECTORP(obj))
-        return ScmVector;
-    else if (VALUEPACKETP(obj))
-        return ScmValuePacket;
-    else if (FUNCP(obj))
-        return ScmFunc;
-    else if (PORTP(obj))
-        return ScmPort;
-    else if (CONTINUATIONP(obj))
-        return ScmContinuation;
-    else if (SCM_CONSTANTP(obj))
-        return ScmConstant;
-    else if (C_POINTERP(obj))
-        return ScmCPointer;
-    else if (C_FUNCPOINTERP(obj))
-        return ScmCFuncPointer;
+    } else if (SCM_TAG_OTHERSP(obj)) {
+        if (SYMBOLP(obj))
+            return ScmSymbol;
+        else if (STRINGP(obj))
+            return ScmString;
+        else if (VECTORP(obj))
+            return ScmVector;
+        else if (VALUEPACKETP(obj))
+            return ScmValuePacket;
+        else if (FUNCP(obj))
+            return ScmFunc;
+        else if (PORTP(obj))
+            return ScmPort;
+        else if (CONTINUATIONP(obj))
+            return ScmContinuation;
+        else if (SCM_CONSTANTP(obj))
+            return ScmConstant;
+        else if (C_POINTERP(obj))
+            return ScmCPointer;
+        else if (C_FUNCPOINTERP(obj))
+            return ScmCFuncPointer;
+    } else if (SCM_TAG_IMMP(obj)) {
+        if (INTP(obj))
+            return ScmInt;
+        else if (CHARP(obj))
+            return ScmChar;
+    }
 
    /* FIXME: Should we need to raise an error here? */
     return ScmInvalid;



More information about the uim-commit mailing list