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

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Jan 10 07:14:01 PST 2006


Author: yamaken
Date: 2006-01-10 07:13:57 -0800 (Tue, 10 Jan 2006)
New Revision: 2885

Modified:
   branches/r5rs/sigscheme/eval.c
   branches/r5rs/sigscheme/operations-srfi2.c
   branches/r5rs/sigscheme/syntax.c
Log:
* ret_type validity of all tailcall have been checked

* sigscheme/syntax.c
  - (scm_s_cond_internal, scm_s_and, scm_s_or, scm_s_begin): Set
    SCM_RETTYPE_AS_IS to eval_state->ret_type even if safe constant
    result, to make code meaning proper
* sigscheme/operations-srfi2.c
  - (scm_s_srfi2_and_letstar): Ditto

* sigscheme/eval.c
  - (scm_p_apply): Remove unneeded comment explained by
    SUPPRESS_EVAL_ARGS


Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2006-01-10 14:36:38 UTC (rev 2884)
+++ branches/r5rs/sigscheme/eval.c	2006-01-10 15:13:57 UTC (rev 2885)
@@ -458,7 +458,6 @@
 
     ENSURE_LIST(last);
 
-    /* The last argument inhibits argument re-evaluation. */
     return call(proc, args, eval_state, SUPPRESS_EVAL_ARGS);
 }
 

Modified: branches/r5rs/sigscheme/operations-srfi2.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi2.c	2006-01-10 14:36:38 UTC (rev 2884)
+++ branches/r5rs/sigscheme/operations-srfi2.c	2006-01-10 15:13:57 UTC (rev 2885)
@@ -107,8 +107,10 @@
             } else {
                 goto err;
             }
-            if (FALSEP(val))
+            if (FALSEP(val)) {
+                eval_state->ret_type = SCM_RETTYPE_AS_IS;
                 return SCM_FALSE;
+            }
         }
         if (!NULLP(claws))
             goto err;

Modified: branches/r5rs/sigscheme/syntax.c
===================================================================
--- branches/r5rs/sigscheme/syntax.c	2006-01-10 14:36:38 UTC (rev 2884)
+++ branches/r5rs/sigscheme/syntax.c	2006-01-10 15:13:57 UTC (rev 2885)
@@ -550,6 +550,7 @@
      * To distinguish unmatched status from SCM_UNDEF from a clause, pure
      * internal value SCM_INVALID is returned. Don't pass it to Scheme world.
      */
+    eval_state->ret_type = SCM_RETTYPE_AS_IS;
     return SCM_INVALID;
 }
 
@@ -580,8 +581,10 @@
     ScmObj expr, val;
     DECLARE_FUNCTION("and", syntax_variadic_tailrec_0);
 
-    if (NO_MORE_ARG(args))
+    if (NO_MORE_ARG(args)) {
+        eval_state->ret_type = SCM_RETTYPE_AS_IS;
         return SCM_TRUE;
+    }
 
     FOR_EACH_BUTLAST (expr, args) {
         val = EVAL(expr, eval_state->env);
@@ -602,8 +605,10 @@
     ScmObj expr, val;
     DECLARE_FUNCTION("or", syntax_variadic_tailrec_0);
 
-    if (NO_MORE_ARG(args))
+    if (NO_MORE_ARG(args)) {
+        eval_state->ret_type = SCM_RETTYPE_AS_IS;
         return SCM_FALSE;
+    }
 
     FOR_EACH_BUTLAST (expr, args) {
         val = EVAL(expr, eval_state->env);
@@ -810,8 +815,10 @@
     ScmObj expr;
     DECLARE_FUNCTION("begin", syntax_variadic_tailrec_0);
 
-    if (NO_MORE_ARG(args))
+    if (NO_MORE_ARG(args)) {
+        eval_state->ret_type = SCM_RETTYPE_AS_IS;
         return SCM_UNDEF;
+    }
 
     FOR_EACH_BUTLAST (expr, args)
         EVAL(expr, eval_state->env);



More information about the uim-commit mailing list