[uim-commit] r1675 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Wed Sep 28 10:13:41 PDT 2005
Author: kzk
Date: 2005-09-28 10:13:39 -0700 (Wed, 28 Sep 2005)
New Revision: 1675
Modified:
branches/r5rs/sigscheme/TODO
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/io.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* Rename 'arg' for argument list to 'args'.
Simplify "case" with new FUNCTYPE scheme
Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO 2005-09-28 17:07:36 UTC (rev 1674)
+++ branches/r5rs/sigscheme/TODO 2005-09-28 17:13:39 UTC (rev 1675)
@@ -63,8 +63,6 @@
* Add a 'SCM' prefix to the global functions listed in sigschemeinternal.h
-* Rename 'arg' for argument list to 'args'
-
* Rename STL names (string, list) to another such as str, lst
* Grand renaming (prefix reorganization, consideration about func_name and
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-09-28 17:07:36 UTC (rev 1674)
+++ branches/r5rs/sigscheme/eval.c 2005-09-28 17:13:39 UTC (rev 1675)
@@ -903,7 +903,7 @@
* - depending on its own true value
* - can appeared in other than last clause
*/
-ScmObj ScmExp_cond(ScmObj arg, ScmEvalState *eval_state)
+ScmObj ScmExp_cond(ScmObj args, ScmEvalState *eval_state)
{
/*
* (cond <clause1> <clause2> ...)
@@ -924,8 +924,8 @@
ScmObj proc = SCM_NULL;
/* looping in each clause */
- for (; !NULLP(arg); arg = CDR(arg)) {
- clause = CAR(arg);
+ for (; !NULLP(args); args = CDR(args)) {
+ clause = CAR(args);
if (!CONSP(clause))
SigScm_ErrorObj("cond : bad clause: ", clause);
@@ -967,24 +967,26 @@
}
/* FIXME: argument extraction */
-ScmObj ScmExp_case(ScmObj arg, ScmEvalState *eval_state)
+ScmObj ScmExp_case(ScmObj key, ScmObj args, ScmEvalState *eval_state)
{
ScmObj env = eval_state->env;
- ScmObj key = EVAL(CAR(arg), env);
ScmObj clause = SCM_NULL;
ScmObj data = SCM_NULL;
ScmObj exps = SCM_NULL;
+ /* get key */
+ key = EVAL(key, env);
+
/* looping in each clause */
- for (arg = CDR(arg); !NULLP(arg); arg = CDR(arg)) {
- clause = CAR(arg);
+ for (; !NULLP(args); args = CDR(args)) {
+ clause = CAR(args);
data = CAR(clause);
exps = CDR(clause);
if (NULLP(clause) || NULLP(data) || NULLP(exps))
SigScm_Error("case : syntax error");
/* check "else" symbol */
- if (NULLP(CDR(arg)) && !CONSP(data) && NFALSEP(SCM_SYMBOL_VCELL(data)))
+ if (NULLP(CDR(args)) && !CONSP(data) && NFALSEP(SCM_SYMBOL_VCELL(data)))
return ScmExp_begin(exps, eval_state);
/* evaluate data and compare to key by eqv? */
@@ -1047,7 +1049,7 @@
/*===========================================================================
R5RS : 4.2 Derived expression types : 4.2.2 Binding constructs
===========================================================================*/
-ScmObj ScmExp_let(ScmObj arg, ScmEvalState *eval_state)
+ScmObj ScmExp_let(ScmObj args, ScmEvalState *eval_state)
{
ScmObj env = eval_state->env;
ScmObj bindings = SCM_NULL;
@@ -1059,16 +1061,16 @@
ScmObj binding = SCM_NULL;
/* sanity check */
- if CHECK_2_ARGS(arg)
+ if CHECK_2_ARGS(args)
SigScm_Error("let : syntax error");
/* guess whether syntax is "Named let" */
- if (SYMBOLP(CAR(arg)))
+ if (SYMBOLP(CAR(args)))
goto named_let;
/* get bindings and body */
- bindings = CAR(arg);
- body = CDR(arg);
+ bindings = CAR(args);
+ body = CDR(args);
/*========================================================================
(let <bindings> <body>)
@@ -1113,8 +1115,8 @@
(<variable2> <init2>)
...)
========================================================================*/
- bindings = CADR(arg);
- body = CDDR(arg);
+ bindings = CADR(args);
+ body = CDDR(args);
for (; !NULLP(bindings); bindings = CDR(bindings)) {
binding = CAR(bindings);
SCM_SHIFT_RAW_2(var, val, binding);
@@ -1126,12 +1128,12 @@
vals = ScmOp_reverse(vals);
/* (define (<variable> <variable1> <variable2> ...>) <body>) */
- ScmExp_define(CAR(arg),
+ ScmExp_define(CAR(args),
LIST_1(Scm_NewClosure(CONS(vars, body), env)),
env);
/* (func <init1> <init2> ...) */
- return CONS(CAR(arg), vals);
+ return CONS(CAR(args), vals);
}
ScmObj ScmExp_let_star(ScmObj bindings, ScmObj body, ScmEvalState *eval_state)
Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c 2005-09-28 17:07:36 UTC (rev 1674)
+++ branches/r5rs/sigscheme/io.c 2005-09-28 17:13:39 UTC (rev 1675)
@@ -295,7 +295,7 @@
return Scm_NewChar(buf);
}
-ScmObj ScmOp_peek_char(ScmObj arg, ScmObj env)
+ScmObj ScmOp_peek_char(ScmObj args, ScmObj env)
{
/* TODO : implement this */
}
@@ -305,7 +305,7 @@
return (EOFP(obj)) ? SCM_TRUE : SCM_FALSE;
}
-ScmObj ScmOp_char_readyp(ScmObj arg, ScmObj env)
+ScmObj ScmOp_char_readyp(ScmObj args, ScmObj env)
{
/* TODO : implement this */
}
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2005-09-28 17:07:36 UTC (rev 1674)
+++ branches/r5rs/sigscheme/sigscheme.c 2005-09-28 17:13:39 UTC (rev 1675)
@@ -167,7 +167,7 @@
Scm_RegisterSyntaxVariadic1("define" , ScmExp_define);
Scm_RegisterSyntaxVariadicTailRec2("if" , ScmExp_if);
Scm_RegisterSyntaxVariadicTailRec0("cond" , ScmExp_cond); /* FIXME */
- Scm_RegisterSyntaxVariadicTailRec0("case" , ScmExp_case); /* FIXME */
+ Scm_RegisterSyntaxVariadicTailRec1("case" , ScmExp_case);
Scm_RegisterSyntaxVariadicTailRec0("let" , ScmExp_let); /* FIXME */
Scm_RegisterSyntaxVariadicTailRec1("let*" , ScmExp_let_star);
Scm_RegisterSyntaxVariadicTailRec1("letrec" , ScmExp_letrec);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-09-28 17:07:36 UTC (rev 1674)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-09-28 17:13:39 UTC (rev 1675)
@@ -367,14 +367,14 @@
ScmObj ScmExp_lambda(ScmObj args, ScmObj env);
ScmObj ScmExp_if(ScmObj test, ScmObj conseq, ScmObj rest, ScmEvalState *eval_state);
ScmObj ScmExp_set(ScmObj var, ScmObj val, ScmObj env);
-ScmObj ScmExp_cond(ScmObj arg, ScmEvalState *eval_state);
-ScmObj ScmExp_case(ScmObj arg, ScmEvalState *eval_state);
-ScmObj ScmExp_and(ScmObj arg, ScmEvalState *eval_state);
-ScmObj ScmExp_or(ScmObj arg, ScmEvalState *eval_state);
-ScmObj ScmExp_let(ScmObj arg, ScmEvalState *eval_state);
+ScmObj ScmExp_cond(ScmObj args, ScmEvalState *eval_state);
+ScmObj ScmExp_case(ScmObj key, ScmObj args, ScmEvalState *eval_state);
+ScmObj ScmExp_and(ScmObj args, ScmEvalState *eval_state);
+ScmObj ScmExp_or(ScmObj args, ScmEvalState *eval_state);
+ScmObj ScmExp_let(ScmObj args, ScmEvalState *eval_state);
ScmObj ScmExp_let_star(ScmObj bindings, ScmObj body, ScmEvalState *eval_state);
ScmObj ScmExp_letrec(ScmObj bindings, ScmObj body, ScmEvalState *eval_state);
-ScmObj ScmExp_begin(ScmObj arg, ScmEvalState *eval_state);
+ScmObj ScmExp_begin(ScmObj args, ScmEvalState *eval_state);
ScmObj ScmExp_do(ScmObj bindings, ScmObj testframe, ScmObj commands, ScmEvalState *eval_state);
ScmObj ScmOp_delay(ScmObj expr, ScmObj env);
ScmObj ScmOp_quasiquote(ScmObj datum, ScmObj env);
@@ -528,9 +528,9 @@
ScmObj ScmOp_read(ScmObj args);
ScmObj ScmOp_read_char(ScmObj args);
-ScmObj ScmOp_peek_char(ScmObj arg, ScmObj env);
+ScmObj ScmOp_peek_char(ScmObj args, ScmObj env);
ScmObj ScmOp_eof_objectp(ScmObj obj);
-ScmObj ScmOp_char_readyp(ScmObj arg, ScmObj env);
+ScmObj ScmOp_char_readyp(ScmObj args, ScmObj env);
ScmObj ScmOp_write(ScmObj obj, ScmObj args);
ScmObj ScmOp_display(ScmObj obj, ScmObj args);
ScmObj ScmOp_newline(ScmObj args);
More information about the uim-commit
mailing list