[uim-commit] r2119 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Nov 11 16:27:12 PST 2005
Author: yamaken
Date: 2005-11-11 16:27:07 -0800 (Fri, 11 Nov 2005)
New Revision: 2119
Modified:
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/sigscheme.h
- (ScmExp_lambda): Change argument organization
* sigscheme/eval.c
- (ScmExp_lambda): Ditto
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-11-12 00:16:49 UTC (rev 2118)
+++ branches/r5rs/sigscheme/eval.c 2005-11-12 00:27:07 UTC (rev 2119)
@@ -856,17 +856,15 @@
/*===========================================================================
R5RS : 4.1 Primitive expression types : 4.1.4 Procedures
===========================================================================*/
-/* FIXME: Accept all arguments as single variadic variable to reduce cons cell
- * consumption. And current 'first_expr' check should be enclosed into
- * SCM_STRICT_ARGCHECK or SCM_STRICT_R5RS.
- */
-ScmObj ScmExp_lambda(ScmObj formals, ScmObj first_expr, ScmObj rest, ScmObj env)
+ScmObj ScmExp_lambda(ScmObj formals, ScmObj body, ScmObj env)
{
- DECLARE_FUNCTION("lambda", SyntaxVariadic2);
+ DECLARE_FUNCTION("lambda", SyntaxVariadic1);
if (!CONSP(formals) && !NULLP(formals) && !SYMBOLP(formals))
ERR_OBJ("bad formals", formals);
- /* (formals first_expr . rest) */
- return Scm_NewClosure(CONS(formals, CONS(first_expr, rest)), env);
+ if (!CONSP(body))
+ ERR_OBJ("at least one expression required", body);
+
+ return Scm_NewClosure(CONS(formals, body), env);
}
/*===========================================================================
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-11-12 00:16:49 UTC (rev 2118)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-11-12 00:27:07 UTC (rev 2119)
@@ -418,7 +418,7 @@
ScmObj ScmOp_eval(ScmObj obj, ScmObj env);
ScmObj ScmOp_apply(ScmObj proc, ScmObj arg0, ScmObj rest, ScmEvalState *eval_state);
ScmObj ScmExp_quote(ScmObj datum, ScmObj env);
-ScmObj ScmExp_lambda(ScmObj formals, ScmObj first_expr, ScmObj rest, ScmObj env);
+ScmObj ScmExp_lambda(ScmObj formals, ScmObj body, ScmObj env);
ScmObj ScmExp_if(ScmObj test, ScmObj conseq, ScmObj rest, ScmEvalState *eval_state);
ScmObj ScmExp_setd(ScmObj var, ScmObj val, ScmObj env);
ScmObj ScmExp_cond(ScmObj args, ScmEvalState *eval_state);
More information about the uim-commit
mailing list