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

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Sep 28 08:17:59 PDT 2005


Author: yamaken
Date: 2005-09-28 08:17:56 -0700 (Wed, 28 Sep 2005)
New Revision: 1667

Modified:
   branches/r5rs/sigscheme/main.c
Log:
* sigscheme/main.c
  - (repl): Simplify


Modified: branches/r5rs/sigscheme/main.c
===================================================================
--- branches/r5rs/sigscheme/main.c	2005-09-28 15:07:56 UTC (rev 1666)
+++ branches/r5rs/sigscheme/main.c	2005-09-28 15:17:56 UTC (rev 1667)
@@ -68,8 +68,6 @@
 #if !SCM_GCC4_READY_GC
     ScmObj stack_start = NULL;
 #endif
-    ScmObj stdin_port  = SCM_NULL;
-    ScmObj stdout_port = SCM_NULL;
     ScmObj s_exp  = SCM_NULL;
     ScmObj result = SCM_NULL;
 
@@ -78,28 +76,21 @@
     SigScm_GC_ProtectStack(&stack_start);
 #endif
 
-    /* init variable */
-    stdin_port  = Scm_NewFilePort(stdin,  "stdin",  PORT_INPUT);
-    stdout_port = Scm_NewFilePort(stdout, "stdout", PORT_OUTPUT); 
-
 #if SCM_COMPAT_SIOD
     if (SigScm_GetVerboseLevel() >= 2)
 #endif
         printf("sscm> ");
 
-    for (s_exp = SigScm_Read(stdin_port);
-         !EOFP(s_exp);
-         s_exp = SigScm_Read(stdin_port))
-    {
+    while (s_exp = SigScm_Read(scm_std_input_port), !EOFP(s_exp)) {
         result = EVAL(s_exp, SCM_INTERACTION_ENV);
 #if SCM_COMPAT_SIOD
         if (SigScm_GetVerboseLevel() >= 1)
 #endif
         {
 #if SCM_USE_SRFI38
-            SigScm_WriteToPortWithSharedStructure(stdout_port, result);
+            SigScm_WriteToPortWithSharedStructure(scm_std_output_port, result);
 #else
-            SigScm_WriteToPort(stdout_port, result);
+            SigScm_WriteToPort(scm_std_output_port, result);
 #endif
             printf("\n");
         }
@@ -109,9 +100,6 @@
 #endif
             printf("sscm> ");
     }
-    
-    ScmOp_close_input_port(stdin_port);
-    ScmOp_close_input_port(stdout_port);
 
 #if !SCM_GCC4_READY_GC
     /* now no need to protect stack */



More information about the uim-commit mailing list