[uim-commit] r1937 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Tue Nov 1 11:56:55 PST 2005
Author: kzk
Date: 2005-11-01 11:56:52 -0800 (Tue, 01 Nov 2005)
New Revision: 1937
Modified:
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* Fix naming inconsistency
* Add missing DECLARE_FUNCTION in eval.c
* sigscheme/sigscheme.h
- (ScmExp_quote): renamed from ScmOp_quote
- (ScmExp_quasiquote): renamed from ScmOp_quasiquote
- (ScmExp_unquote): renamed from ScmOp_unquote
- (ScmExp_unquote_splicing): renamed from ScmOp_unquote_splicing
- (ScmExp_delay): renamed from ScmOp_delay
* sigscheme/eval.c
- (ScmOp_apply): add missing DECLARE_FUNCTION
- (ScmExp_setd): add missing DECLARE_FUNCTION
- (ScmExp_cond): add missing DECLARE_FUNCTION
- (ScmExp_case): add missing DECLARE_FUNCTION
- (ScmExp_let): add missing DECLARE_FUNCTION
- (ScmExp_letstar): add missing DECLARE_FUNCTION
- (ScmOp_scheme_report_environment): add missing DECLARE_FUNCTION
- (ScmOp_null_environment): add missing DECLARE_FUNCTION
- (ScmOp_interaction_environment): add missing DECLARE_FUNCTION
- (ScmExp_quote):
- renamed from ScmOp_quote
- add missing DECLARE_FUNCTION
- (ScmExp_quasiquote):
- renamed from ScmOp_quasiquote
- add missing DECLARE_FUNCTION
- (ScmExp_unquote):
- renamed from ScmOp_unquote
- add missing DECLARE_FUNCTION
- (ScmExp_unquote_splicing):
- renamed from ScmOp_unquote_splicing
- add missing DECLARE_FUNCTION
- (ScmExp_delay)
- renamed from ScmOp_delay
- add missing DECLARE_FUNCTION
* sigscheme/sigscheme.c
- (SigScm_Initialize_internal)
- (ScmExp_quote): renamed from ScmOp_quote
- (ScmExp_quasiquote): renamed from ScmOp_quasiquote
- (ScmExp_unquote): renamed from ScmOp_unquote
- (ScmExp_unquote_splicing): renamed from ScmOp_unquote_splicing
- (ScmExp_delay): renamed from ScmOp_delay
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-11-01 19:39:48 UTC (rev 1936)
+++ branches/r5rs/sigscheme/eval.c 2005-11-01 19:56:52 UTC (rev 1937)
@@ -521,6 +521,8 @@
ScmObj last = SCM_INVALID;
ScmObj lst = SCM_INVALID;
+ DECLARE_FUNCTION("apply", ProcedureVariadicTailRec2);
+
if (NULLP(rest)) {
args = last = arg0;
} else {
@@ -839,9 +841,9 @@
/*===========================================================================
R5RS : 4.1 Primitive expression types : 4.1.2 Literal expressions
===========================================================================*/
-/* FIXME: rename to ScmExp_quote since quote is a syntax */
-ScmObj ScmOp_quote(ScmObj datum, ScmObj env)
+ScmObj ScmExp_quote(ScmObj datum, ScmObj env)
{
+ DECLARE_FUNCTION("quote", SyntaxFixed1);
return datum;
}
@@ -891,6 +893,7 @@
{
ScmObj evaled = SCM_FALSE;
ScmObj locally_bound = SCM_NULL;
+ DECLARE_FUNCTION("set!", SyntaxFixed2);
evaled = EVAL(exp, env);
locally_bound = Scm_LookupEnvironment(sym, env);
@@ -946,6 +949,7 @@
ScmObj test = SCM_NULL;
ScmObj exps = SCM_NULL;
ScmObj proc = SCM_NULL;
+ DECLARE_FUNCTION("cond", SyntaxVariadicTailRec0);
/* looping in each clause */
for (; !NULLP(args); args = CDR(args)) {
@@ -997,6 +1001,7 @@
ScmObj clause = SCM_NULL;
ScmObj data = SCM_NULL;
ScmObj exps = SCM_NULL;
+ DECLARE_FUNCTION("case", SyntaxVariadicTailRec1);
/* get key */
key = EVAL(key, env);
@@ -1091,6 +1096,7 @@
ScmObj val = SCM_FALSE;
ScmObj vars = SCM_NULL;
ScmObj vals = SCM_NULL;
+ DECLARE_FUNCTION("let", SyntaxVariadicTalRec0);
/*========================================================================
normal let:
@@ -1163,6 +1169,7 @@
ScmObj var = SCM_FALSE;
ScmObj val = SCM_FALSE;
ScmObj binding = SCM_FALSE;
+ DECLARE_FUNCTION("let*", SyntaxVariadicTalRec1);
/*========================================================================
(let* <bindings> <body>)
@@ -1212,6 +1219,7 @@
ScmObj binding = SCM_FALSE;
ScmObj var = SCM_FALSE;
ScmObj val = SCM_FALSE;
+ DECLARE_FUNCTION("letrec", SyntaxVariadicTalRec1);
/*========================================================================
(letrec <bindings> <body>)
@@ -1296,6 +1304,7 @@
ScmObj tmp_vars = SCM_NULL;
ScmObj tmp_steps = SCM_NULL;
ScmObj obj = SCM_NULL;
+ DECLARE_FUNCTION("do", SyntaxVariadicTailRec2);
/* construct Environment and steps */
for (; !NULLP(bindings); bindings = CDR(bindings)) {
@@ -1361,9 +1370,10 @@
/*===========================================================================
R5RS : 4.2 Derived expression types : 4.2.5 Delayed evaluation
===========================================================================*/
-/* FIXME: rename to ScmExp_delay since delay is a syntax */
-ScmObj ScmOp_delay(ScmObj expr, ScmObj env)
+ScmObj ScmExp_delay(ScmObj expr, ScmObj env)
{
+ DECLARE_FUNCTION("delay", SyntaxFixed1);
+
/* (lambda () exp) */
return Scm_NewClosure(SCM_LIST_2(SCM_NULL, expr), env);
}
@@ -1371,30 +1381,27 @@
/*===========================================================================
R5RS : 4.2 Derived expression types : 4.2.6 Quasiquotation
===========================================================================*/
-/* FIXME: rename to ScmExp_quasiquote since quasiquote is a syntax */
-ScmObj ScmOp_quasiquote(ScmObj datum, ScmObj env)
+ScmObj ScmExp_quasiquote(ScmObj datum, ScmObj env)
{
- ScmObj ret;
- ret = qquote_internal(datum, env, 1);
+ DECLARE_FUNCTION("quasiquote", SyntaxFixed1);
- if (QQUOTE_IS_VERBATIM(ret))
+ if (QQUOTE_IS_VERBATIM(qquote_internal(datum, env, 1)))
return datum;
return ret;
}
-/* FIXME: rename to ScmExp_unquote since unquote is a syntax */
-ScmObj ScmOp_unquote(ScmObj dummy, ScmObj env)
+ScmObj ScmExp_unquote(ScmObj dummy, ScmObj env)
{
+ DECLARE_FUNCTION("unquote", SyntaxFixed1);
+
SigScm_Error("unquote outside quasiquote");
return SCM_NULL;
}
-/*
- * FIXME: rename to ScmExp_unquote_splicing since unquote_splicing is a
- * syntax
- */
-ScmObj ScmOp_unquote_splicing(ScmObj dummy, ScmObj env)
+ScmObj ScmExp_unquote_splicing(ScmObj dummy, ScmObj env)
{
+ DECLARE_FUNCTION("unquote-splicing", SyntaxFixed1);
+
SigScm_Error("unquote-splicing outside quasiquote");
return SCM_NULL;
}
@@ -1420,6 +1427,7 @@
ScmObj procname = SCM_FALSE;
ScmObj body = SCM_FALSE;
ScmObj formals = SCM_FALSE;
+ DECLARE_FUNCTION("define", SyntaxVariadic1);
/*========================================================================
(define <variable> <expression>)
@@ -1467,6 +1475,8 @@
=======================================*/
ScmObj ScmOp_scheme_report_environment(ScmObj version)
{
+ DECLARE_FUNCTION("scheme-report-environment", ProcedureFixed1);
+
/* sanity check */
if (!INTP(version))
SigScm_ErrorObj("scheme-report-environment : int required but got ", version);
@@ -1485,6 +1495,8 @@
ScmObj ScmOp_null_environment(ScmObj version)
{
+ DECLARE_FUNCTION("null-environment", ProcedureFixed1);
+
/* sanity check */
if (!INTP(version))
SigScm_ErrorObj("null-environment : int required but got ", version);
@@ -1503,5 +1515,6 @@
ScmObj ScmOp_interaction_environment(void)
{
+ DECLARE_FUNCTION("interaction-environment", ProcedureFixed0);
return SCM_INTERACTION_ENV;
}
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2005-11-01 19:39:48 UTC (rev 1936)
+++ branches/r5rs/sigscheme/sigscheme.c 2005-11-01 19:56:52 UTC (rev 1937)
@@ -185,13 +185,13 @@
/* eval.c */
Scm_RegisterProcedureFixed2("eval" , ScmOp_eval);
Scm_RegisterProcedureVariadicTailRec2("apply" , ScmOp_apply);
- Scm_RegisterSyntaxFixed1("quote" , ScmOp_quote);
+ Scm_RegisterSyntaxFixed1("quote" , ScmOp_quote);
Scm_RegisterSyntaxVariadic2("lambda" , ScmExp_lambda);
- Scm_RegisterSyntaxFixed2("set!" , ScmExp_setd);
- Scm_RegisterSyntaxFixed1("delay" , ScmOp_delay);
- Scm_RegisterSyntaxFixed1("quasiquote" , ScmOp_quasiquote);
- Scm_RegisterSyntaxFixed1("unquote" , ScmOp_unquote);
- Scm_RegisterSyntaxFixed1("unquote-splicing" , ScmOp_unquote_splicing);
+ Scm_RegisterSyntaxFixed2("set!" , ScmExp_setd);
+ Scm_RegisterSyntaxFixed1("delay" , ScmExp_delay);
+ Scm_RegisterSyntaxFixed1("quasiquote" , ScmExp_quasiquote);
+ Scm_RegisterSyntaxFixed1("unquote" , ScmExp_unquote);
+ Scm_RegisterSyntaxFixed1("unquote-splicing" , ScmExp_unquote_splicing);
Scm_RegisterSyntaxVariadic1("define" , ScmExp_define);
Scm_RegisterSyntaxVariadicTailRec2("if" , ScmExp_if);
Scm_RegisterSyntaxVariadicTailRec0("cond" , ScmExp_cond); /* FIXME */
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-11-01 19:39:48 UTC (rev 1936)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-11-01 19:56:52 UTC (rev 1937)
@@ -425,7 +425,7 @@
/* eval.c */
ScmObj ScmOp_eval(ScmObj obj, ScmObj env);
ScmObj ScmOp_apply(ScmObj proc, ScmObj arg0, ScmObj rest, ScmEvalState *eval_state);
-ScmObj ScmOp_quote(ScmObj datum, ScmObj env);
+ScmObj ScmExp_quote(ScmObj datum, ScmObj env);
ScmObj ScmExp_lambda(ScmObj formals, ScmObj first_expr, ScmObj rest, ScmObj env);
ScmObj ScmExp_if(ScmObj test, ScmObj conseq, ScmObj rest, ScmEvalState *eval_state);
ScmObj ScmExp_setd(ScmObj var, ScmObj val, ScmObj env);
@@ -438,10 +438,10 @@
ScmObj ScmExp_letrec(ScmObj bindings, ScmObj body, 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);
-ScmObj ScmOp_unquote(ScmObj dummy, ScmObj env);
-ScmObj ScmOp_unquote_splicing(ScmObj dummy, ScmObj env);
+ScmObj ScmExp_delay(ScmObj expr, ScmObj env);
+ScmObj ScmExp_quasiquote(ScmObj datum, ScmObj env);
+ScmObj ScmExp_unquote(ScmObj dummy, ScmObj env);
+ScmObj ScmExp_unquote_splicing(ScmObj dummy, ScmObj env);
ScmObj ScmExp_define(ScmObj var, ScmObj rest, ScmObj env);
ScmObj ScmOp_scheme_report_environment(ScmObj version);
ScmObj ScmOp_null_environment(ScmObj version);
More information about the uim-commit
mailing list