[uim-commit] r2773 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Jan 4 07:18:58 PST 2006
Author: yamaken
Date: 2006-01-04 07:18:53 -0800 (Wed, 04 Jan 2006)
New Revision: 2773
Modified:
branches/r5rs/sigscheme/env.c
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/env.c
- (scm_symbol_value): Move back to eval.c since it's not environment
implementation itself
* sigscheme/eval.c
- (scm_symbol_value): Moved from env.c
* sigscheme/sigschemeinternal.h
- Reorganize sections
Modified: branches/r5rs/sigscheme/env.c
===================================================================
--- branches/r5rs/sigscheme/env.c 2006-01-04 13:21:39 UTC (rev 2772)
+++ branches/r5rs/sigscheme/env.c 2006-01-04 15:18:53 UTC (rev 2773)
@@ -201,26 +201,3 @@
return SCM_INVALID_REF;
}
-
-/* 'var' must be a symbol as precondition */
-ScmObj
-scm_symbol_value(ScmObj var, ScmObj env)
-{
- ScmRef ref;
- ScmObj val;
- DECLARE_INTERNAL_FUNCTION("scm_symbol_value");
-
- /* first, lookup the environment */
- ref = scm_lookup_environment(var, env);
- if (ref != SCM_INVALID_REF) {
- /* variable is found in environment, so returns its value */
- return DEREF(ref);
- }
-
- /* finally, look at the VCELL */
- val = SCM_SYMBOL_VCELL(var);
- if (EQ(val, SCM_UNBOUND))
- ERR_OBJ("unbound variable", var);
-
- return val;
-}
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2006-01-04 13:21:39 UTC (rev 2772)
+++ branches/r5rs/sigscheme/eval.c 2006-01-04 15:18:53 UTC (rev 2773)
@@ -72,6 +72,29 @@
/*=======================================
Function Implementations
=======================================*/
+/* 'var' must be a symbol as precondition */
+ScmObj
+scm_symbol_value(ScmObj var, ScmObj env)
+{
+ ScmRef ref;
+ ScmObj val;
+ DECLARE_INTERNAL_FUNCTION("scm_symbol_value");
+
+ /* first, lookup the environment */
+ ref = scm_lookup_environment(var, env);
+ if (ref != SCM_INVALID_REF) {
+ /* variable is found in environment, so returns its value */
+ return DEREF(ref);
+ }
+
+ /* finally, look at the VCELL */
+ val = SCM_SYMBOL_VCELL(var);
+ if (EQ(val, SCM_UNBOUND))
+ ERR_OBJ("unbound variable", var);
+
+ return val;
+}
+
/* A wrapper for call() for internal proper tail recursion */
ScmObj
scm_tailcall(ScmObj proc, ScmObj args, ScmEvalState *eval_state)
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-04 13:21:39 UTC (rev 2772)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2006-01-04 15:18:53 UTC (rev 2773)
@@ -476,11 +476,11 @@
ScmObj scm_extend_environment(ScmObj vars, ScmObj vals, ScmObj env);
ScmObj scm_add_environment(ScmObj var, ScmObj val, ScmObj env);
ScmRef scm_lookup_environment(ScmObj var, ScmObj env);
-ScmObj scm_symbol_value(ScmObj var, ScmObj env);
/* eval.c */
+ScmObj scm_symbol_value(ScmObj var, ScmObj env);
+ScmObj scm_tailcall(ScmObj proc, ScmObj args, ScmEvalState *eval_state);
ScmObj scm_eval(ScmObj obj, ScmObj env);
-ScmObj scm_tailcall(ScmObj proc, ScmObj args, ScmEvalState *eval_state);
/* syntax.c */
ScmObj scm_s_cond_internal(ScmObj args, ScmObj case_key, ScmEvalState *eval_state);
More information about the uim-commit
mailing list