[uim-commit] r1718 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Sep 30 17:34:05 PDT 2005
Author: yamaken
Date: 2005-09-30 17:34:03 -0700 (Fri, 30 Sep 2005)
New Revision: 1718
Modified:
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/sigscheme.h
- (ScmOp_call_with_values): Change function type to make properly
tail recursive
* sigscheme/operations.c
- (ScmOp_call_with_values): Make properly tail recursive
* sigscheme/sigscheme.c
- (SigScm_Initialize_internal): Change function type for
call-with-values
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-10-01 00:30:47 UTC (rev 1717)
+++ branches/r5rs/sigscheme/operations.c 2005-10-01 00:34:03 UTC (rev 1718)
@@ -1802,7 +1802,8 @@
#endif
}
-ScmObj ScmOp_call_with_values(ScmObj producer, ScmObj consumer)
+ScmObj ScmOp_call_with_values(ScmObj producer, ScmObj consumer,
+ ScmEvalState *eval_state)
{
ScmObj vals;
@@ -1827,7 +1828,9 @@
}
#endif
- return Scm_call(consumer, vals);
+ /* call(consumer, vals, eval_state, 1) as proper tail recursion */
+ eval_state->ret_type = SCM_RETTYPE_NEED_CALL_AS_IS;
+ return CONS(consumer, vals);
}
#if SCM_USE_SRFI1
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2005-10-01 00:30:47 UTC (rev 1717)
+++ branches/r5rs/sigscheme/sigscheme.c 2005-10-01 00:34:03 UTC (rev 1718)
@@ -275,7 +275,7 @@
Scm_RegisterProcedureFixed1("force" , ScmOp_force);
Scm_RegisterProcedureVariadic0("values" , ScmOp_values);
Scm_RegisterProcedureFixed1("call-with-current-continuation", ScmOp_call_with_current_continuation);
- Scm_RegisterProcedureFixed2("call-with-values" , ScmOp_call_with_values);
+ Scm_RegisterProcedureFixedTailRec2("call-with-values", ScmOp_call_with_values);
/* io.c */
Scm_RegisterProcedureFixed2("call-with-input-file" , ScmOp_call_with_input_file);
Scm_RegisterProcedureFixed2("call-with-output-file" , ScmOp_call_with_output_file);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-10-01 00:30:47 UTC (rev 1717)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-10-01 00:34:03 UTC (rev 1718)
@@ -508,7 +508,7 @@
ScmObj ScmOp_force(ScmObj closure);
ScmObj ScmOp_call_with_current_continuation(ScmObj proc);
ScmObj ScmOp_values(ScmObj args);
-ScmObj ScmOp_call_with_values(ScmObj producer, ScmObj consumer);
+ScmObj ScmOp_call_with_values(ScmObj producer, ScmObj consumer, ScmEvalState *eval_state);
/* io.c */
void SigScm_set_lib_path(const char *path);
More information about the uim-commit
mailing list