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

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Oct 2 07:11:55 PDT 2005


Author: yamaken
Date: 2005-10-02 07:11:53 -0700 (Sun, 02 Oct 2005)
New Revision: 1734

Modified:
   branches/r5rs/sigscheme/eval.c
   branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigschemeinternal.h
  - (Scm_tailcall): New function decl
* sigscheme/eval.c
  - (Scm_tailcall): New function


Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2005-10-02 06:19:21 UTC (rev 1733)
+++ branches/r5rs/sigscheme/eval.c	2005-10-02 14:11:53 UTC (rev 1734)
@@ -219,6 +219,13 @@
     return SCM_NULL;
 }
 
+/* A wrapper for call() for internal proper tail recursion */
+ScmObj Scm_tailcall(ScmObj proc, ScmObj args, ScmEvalState *eval_state)
+{
+    eval_state->ret_type = SCM_RETTYPE_AS_IS;
+    return call(proc, args, eval_state, 1);
+}
+
 /* Wrapper for call().  Just like ScmOp_apply(), except ARGS is used
  * as given---nothing special is done about the last item in the
  * list. */

Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2005-10-02 06:19:21 UTC (rev 1733)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2005-10-02 14:11:53 UTC (rev 1734)
@@ -353,6 +353,8 @@
 ScmObj Scm_LookupEnvironment(ScmObj var, ScmObj env);
 ScmObj Scm_SymbolValue(ScmObj var, ScmObj env);
 
+ScmObj Scm_tailcall(ScmObj proc, ScmObj args, ScmEvalState *eval_state);
+
 /* error.c */
 void SigScm_ShowErrorHeader(void);
 void SigScm_ErrorPrintf(const char *fmt, ...);



More information about the uim-commit mailing list