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

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Oct 4 10:59:06 PDT 2005


Author: yamaken
Date: 2005-10-04 10:59:03 -0700 (Tue, 04 Oct 2005)
New Revision: 1807

Modified:
   branches/r5rs/sigscheme/operations-srfi34.c
   branches/r5rs/sigscheme/read.c
Log:
* sigscheme/read.c
  - (SigScm_Read, SigScm_Read_Char): Simplify with
    DECLARE_INTERNAL_FUNCTION()
* sigscheme/operations-srfi34.c
  - (guard_handle_clauses): Ditto


Modified: branches/r5rs/sigscheme/operations-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi34.c	2005-10-04 17:44:37 UTC (rev 1806)
+++ branches/r5rs/sigscheme/operations-srfi34.c	2005-10-04 17:59:03 UTC (rev 1807)
@@ -166,6 +166,7 @@
     ScmObj exps    = SCM_FALSE;
     ScmObj proc    = SCM_FALSE;
     ScmObj ret     = SCM_FALSE;
+    DECLARE_INTERNAL_FUNCTION("guard");
 
     /* make sweepable */
     exception_thrown_obj = SCM_FALSE;
@@ -174,7 +175,7 @@
     for (; !NULLP(clauses); clauses = CDR(clauses)) {
         clause = CAR(clauses);
         if (!CONSP(clause))
-            Scm_ErrorObj("guard", "bad clause ", clause);
+            ERR_OBJ("bad clause ", clause);
 
         test = CAR(clause);
         exps = CDR(clause);
@@ -200,7 +201,7 @@
             if (EQ(Scm_Intern("=>"), CAR(exps))) {
                 proc = EVAL(CADR(exps), env);
                 if (FALSEP(ScmOp_procedurep(proc)))
-                    Scm_ErrorObj("guard", "the value of exp after => must be the procedure but got ", proc);
+                    ERR_OBJ("the value of exp after => must be the procedure but got ", proc);
 
                 return Scm_call(proc, LIST_1(test));
             }
@@ -214,7 +215,7 @@
 
     /* "reraise" exception */
     if (NULLP(CURRENT_EXCEPTION_CONTINUATION()))
-        SigScm_Error("guard : cannot reraise exception");
+        ERR("guard: cannot reraise exception");
     ScmOp_SRFI34_raise(thrown);
 
     /* never reaches here */

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-10-04 17:44:37 UTC (rev 1806)
+++ branches/r5rs/sigscheme/read.c	2005-10-04 17:59:03 UTC (rev 1807)
@@ -121,9 +121,9 @@
 ScmObj SigScm_Read(ScmObj port)
 {
     ScmObj sexp = SCM_FALSE;
+    DECLARE_INTERNAL_FUNCTION("SigScm_Read");
 
-    if (!PORTP(port))
-        Scm_ErrorObj("SigScm_Read", "port required but got ", port);
+    ASSERT_PORTP(port);
 
     sexp = read_sexpression(port);
 #if SCM_DEBUG
@@ -138,9 +138,10 @@
 
 ScmObj SigScm_Read_Char(ScmObj port)
 {
-    if (!PORTP(port))
-        Scm_ErrorObj("SigScm_Read_Char", "port required but got ", port);
+    DECLARE_INTERNAL_FUNCTION("SigScm_Read_Char");
 
+    ASSERT_PORTP(port);
+
     return read_char(port);
 }
 



More information about the uim-commit mailing list