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

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Oct 3 06:12:42 PDT 2005


Author: yamaken
Date: 2005-10-03 06:12:39 -0700 (Mon, 03 Oct 2005)
New Revision: 1771

Modified:
   branches/r5rs/sigscheme/sigscheme.c
Log:
* sigscheme/sigscheme.c
  - (SigScm_Initialize_internal):
    * Reorganize sections
    * Add some FIXME comments


Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c	2005-10-03 12:19:14 UTC (rev 1770)
+++ branches/r5rs/sigscheme/sigscheme.c	2005-10-03 13:12:39 UTC (rev 1771)
@@ -86,16 +86,16 @@
 
 static void SigScm_Initialize_internal(void)
 {
+    /*=======================================================================
+      Core
+    =======================================================================*/
     SigScm_SetDebugCategories(SCM_DBG_ERRMSG | SCM_DBG_BACKTRACE
                               | SigScm_PredefinedDebugCategories());
+    SigScm_InitStorage();
 
     /*=======================================================================
-      Storage Initialization
+      Predefined Symbols and Variables
     =======================================================================*/
-    SigScm_InitStorage();
-    /*=======================================================================
-      Interned Variable Initialization
-    =======================================================================*/
     SigScm_quote            = Scm_Intern("quote");
     SigScm_quasiquote       = Scm_Intern("quasiquote");
     SigScm_unquote          = Scm_Intern("unquote");
@@ -104,19 +104,21 @@
     SigScm_features         = Scm_Intern("*features*");
     SCM_SYMBOL_SET_VCELL(SigScm_features, SCM_NULL);
 #endif
-    /*=======================================================================
-      Export Scheme Special Symbols
-    =======================================================================*/
+
 #if 0
-    /* really required? */
+    /* FIXME: really required? */
     SCM_SYMBOL_SET_VCELL(Scm_Intern("#t"),   SCM_TRUE);
     SCM_SYMBOL_SET_VCELL(Scm_Intern("#f"),   SCM_FALSE);
 #endif
+#if 1
+    /* FIXME: don't set SCM_TRUE and rely on the value */
     SCM_SYMBOL_SET_VCELL(Scm_Intern("else"), SCM_TRUE);
     SCM_SYMBOL_SET_VCELL(Scm_Intern("=>"),   SCM_TRUE);
-    /*=======================================================================
-      Symbol-less Internal Variables
-    =======================================================================*/
+#else
+    SigScm_foo              = Scm_Intern("=>");
+    SigScm_else             = Scm_Intern("else");
+#endif
+
 #if SCM_USE_VALUECONS
     /*
      * To keep storage model abstract, the cell is allocated from a heap
@@ -126,9 +128,26 @@
     SCM_ENTYPE_VALUEPACKET(SigScm_null_values);
     SigScm_GC_Protect(&SigScm_null_values);
 #endif
+
     /*=======================================================================
-      Export Scheme Functions
+      Preallocated Ports
     =======================================================================*/
+    scm_std_input_port  = Scm_NewFilePort(stdin,  "stdin",  PORT_INPUT);
+    scm_std_output_port = Scm_NewFilePort(stdout, "stdout", PORT_OUTPUT);
+    scm_std_error_port  = Scm_NewFilePort(stderr, "stderr", PORT_OUTPUT);
+    scm_current_input_port  = scm_std_input_port;
+    scm_current_output_port = scm_std_output_port;
+    scm_current_error_port  = scm_std_error_port;
+    SigScm_GC_Protect(&scm_std_input_port);
+    SigScm_GC_Protect(&scm_std_output_port);
+    SigScm_GC_Protect(&scm_std_error_port);
+    SigScm_GC_Protect(&scm_current_input_port);
+    SigScm_GC_Protect(&scm_current_output_port);
+    SigScm_GC_Protect(&scm_current_error_port);
+
+    /*=======================================================================
+      R5RS Syntaxes and Procedures
+    =======================================================================*/
     /* eval.c */
     Scm_RegisterProcedureFixed2("eval"                     , ScmOp_eval);
     Scm_RegisterProcedureVariadicTailRec2("apply"           , ScmOp_apply);
@@ -296,6 +315,10 @@
     Scm_RegisterProcedureVariadic0("newline"     , ScmOp_newline);
     Scm_RegisterProcedureVariadic1("write-char"      , ScmOp_write_char);
     Scm_RegisterProcedureFixed1("load"                     , ScmOp_load);
+
+    /*=======================================================================
+      Optional Syntaxes and Procedures
+    =======================================================================*/
 #if SCM_USE_NONSTD_FEATURES
     Scm_RegisterProcedureFixed1("require"                  , ScmOp_require);
     Scm_RegisterProcedureFixed1("provide"                  , ScmOp_provide);
@@ -305,22 +328,6 @@
     Scm_DefineAlias("call/cc", "call-with-current-continuation");
 #endif
 
-    /*=======================================================================
-      Current Input & Output Initialization
-    =======================================================================*/
-    scm_std_input_port  = Scm_NewFilePort(stdin,  "stdin",  PORT_INPUT);
-    scm_std_output_port = Scm_NewFilePort(stdout, "stdout", PORT_OUTPUT);
-    scm_std_error_port  = Scm_NewFilePort(stderr, "stderr", PORT_OUTPUT);
-    scm_current_input_port  = scm_std_input_port;
-    scm_current_output_port = scm_std_output_port;
-    scm_current_error_port  = scm_std_error_port;
-    SigScm_GC_Protect(&scm_std_input_port);
-    SigScm_GC_Protect(&scm_std_output_port);
-    SigScm_GC_Protect(&scm_std_error_port);
-    SigScm_GC_Protect(&scm_current_input_port);
-    SigScm_GC_Protect(&scm_current_output_port);
-    SigScm_GC_Protect(&scm_current_error_port);
-
 #if SCM_USE_SRFI1
     SigScm_Initialize_SRFI1();
 #endif



More information about the uim-commit mailing list