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

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Oct 3 15:25:28 PDT 2005


Author: yamaken
Date: 2005-10-03 15:25:25 -0700 (Mon, 03 Oct 2005)
New Revision: 1783

Modified:
   branches/r5rs/sigscheme/io.c
Log:
* sigscheme/io.c
  - Revert r1778 since other Scheme implementation uses string as
    feature identifier
  - (ScmOp_provide, ScmOp_providedp): Follow the revert with
    ASSERT_STRINGP()


Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-10-03 22:06:56 UTC (rev 1782)
+++ branches/r5rs/sigscheme/io.c	2005-10-03 22:25:25 UTC (rev 1783)
@@ -72,7 +72,7 @@
 #endif /* SCM_GCC4_READY_GC */
 static char*  create_valid_path(const char *c_filename);
 #if SCM_USE_NONSTD_FEATURES
-static ScmObj create_loaded_sym(ScmObj filename);
+static ScmObj create_loaded_str(ScmObj filename);
 static int    file_existsp(const char *filepath);
 #endif
 
@@ -483,29 +483,32 @@
 
 ScmObj ScmOp_require(ScmObj filename)
 {
-    ScmObj loaded_sym = SCM_FALSE;
+    ScmObj loaded_str = SCM_FALSE;
+#if SCM_COMPAT_SIOD
+    ScmObj retsym     = SCM_FALSE;
+#endif
 
     if (!STRINGP(filename))
         SigScm_ErrorObj("require : string required but got ", filename);
 
-    loaded_sym = create_loaded_sym(filename);
-    if (FALSEP(ScmOp_providedp(loaded_sym))) {
+    loaded_str = create_loaded_str(filename);
+    if (FALSEP(ScmOp_providedp(loaded_str))) {
         ScmOp_load(filename);
-        ScmOp_provide(loaded_sym);
+        ScmOp_provide(loaded_str);
     }
 
 #if SCM_COMPAT_SIOD
-    SCM_SYMBOL_SET_VCELL(loaded_sym, SCM_TRUE);
+    retsym = Scm_Intern(SCM_STRING_STR(loaded_str));
+    SCM_SYMBOL_SET_VCELL(retsym, SCM_TRUE);
 
-    return loaded_sym;
+    return retsym;
 #else
     return SCM_TRUE;
 #endif
 }
 
-static ScmObj create_loaded_sym(ScmObj filename)
+static ScmObj create_loaded_str(ScmObj filename)
 {
-    ScmObj loaded_sym = SCM_FALSE;
     char  *loaded_str = NULL;
     int    size = 0;
 
@@ -513,10 +516,8 @@
     size = (strlen(SCM_STRING_STR(filename)) + strlen("*-loaded*") + 1);
     loaded_str = (char*)malloc(sizeof(char) * size);
     snprintf(loaded_str, size, "*%s-loaded*", SCM_STRING_STR(filename));
-    loaded_sym = Scm_Intern(loaded_str);
-    free(loaded_str);
     
-    return loaded_sym;
+    return Scm_NewString(loaded_str);
 }
 
 /*
@@ -527,7 +528,7 @@
 {
     DECLARE_FUNCTION("provide", ProcedureFixed1);
 
-    ASSERT_SYMBOLP(feature);
+    ASSERT_STRINGP(feature);
 
     /* record to SigScm_features */
     SCM_SYMBOL_SET_VCELL(SigScm_features,
@@ -545,10 +546,10 @@
     ScmObj provided = SCM_FALSE;
     DECLARE_FUNCTION("provided?", ProcedureFixed1);
 
-    ASSERT_SYMBOLP(feature);
-    
-    provided = ScmOp_memq(feature, SCM_SYMBOL_VCELL(SigScm_features));
+    ASSERT_STRINGP(feature);
 
+    provided = ScmOp_member(feature, SCM_SYMBOL_VCELL(SigScm_features));
+
     return (NFALSEP(provided)) ? SCM_TRUE : SCM_FALSE;
 }
 



More information about the uim-commit mailing list