[uim-commit] r1787 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Oct 3 16:19:28 PDT 2005
Author: yamaken
Date: 2005-10-03 16:19:24 -0700 (Mon, 03 Oct 2005)
New Revision: 1787
Modified:
branches/r5rs/sigscheme/operations-siod.c
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/sigscheme.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* This commit generalizes 'symbol-bound?' into SCM_USE_NONSTD_FEATURES
from SCM_COMPAT_SIOD. The implementation is fully compatible with
SIOD's (previous implementaion has a misunderstanding about the
specification of SIOD's)
* sigscheme/sigscheme.h
- (ScmOp_symbol_boundp): Enclose into SCM_USE_NONSTD_FEATURES and
move section
* sigscheme/operations-siod.c
- (ScmOp_symbol_boundp): Move to operations.c
* sigscheme/operations.c
- (ScmOp_symbol_boundp):
* Moved from operations-siod.c
* Remove the enclosed in SCM_COMPAT_SIOD_BUGS. The behavior is not
SIOD-compatible and current implementation is the correctly
compatible
* Enclosed into SCM_USE_NONSTD_FEATURES
* sigscheme/sigscheme.c
- (SigScm_Initialize_internal): Moved symbol-bound? initialization
from operations-siod.c
Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c 2005-10-03 22:47:45 UTC (rev 1786)
+++ branches/r5rs/sigscheme/operations-siod.c 2005-10-03 23:19:24 UTC (rev 1787)
@@ -97,7 +97,6 @@
Scm_DefineAlias("bit-xor" , "logxor");
Scm_DefineAlias("bit-not" , "lognot");
- Scm_RegisterProcedureVariadic1("symbol-bound?" , ScmOp_symbol_boundp);
Scm_RegisterProcedureFixed1("symbol-value" , ScmOp_symbol_value);
Scm_RegisterProcedureFixed2("set-symbol-value!" , ScmOp_set_symbol_value);
#if SCM_COMPAT_SIOD_BUGS
@@ -112,36 +111,6 @@
/*
* TODO:
- * - generalize to SCM_USE_NONSTD_FEATURES
- * - describe compatibility with de facto standard of other Scheme
- * implementations (accept env as optional arg, etc)
- */
-ScmObj ScmOp_symbol_boundp(ScmObj sym, ScmObj rest)
-{
-#if !SCM_COMPAT_SIOD_BUGS
- ScmObj env = SCM_INVALID;
-#endif
- DECLARE_FUNCTION("symbol-bound?", ProcedureVariadic1);
-
- ASSERT_SYMBOLP(sym);
-
-#if SCM_COMPAT_SIOD_BUGS
- /* SIOD compatible implementation */
- return (SCM_SYMBOL_BOUNDP(sym)) ? SCM_TRUE : SCM_FALSE;
-#else
- env = POP_ARG(rest);
- if (VALIDP(env))
- ASSERT_ENVP(env);
- else
- env = SCM_INTERACTION_ENV;
-
- return (!NULLP(Scm_LookupEnvironment(sym, env))
- || SCM_SYMBOL_BOUNDP(sym)) ? SCM_TRUE : SCM_FALSE;
-#endif
-}
-
-/*
- * TODO:
* - replace with a portable proc such as (eval 'sym (interaction-environment))
* - make the portable proc interface similar to a de facto standard of other
* Scheme implementations if existing
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-10-03 22:47:45 UTC (rev 1786)
+++ branches/r5rs/sigscheme/operations.c 2005-10-03 23:19:24 UTC (rev 1787)
@@ -1869,6 +1869,34 @@
return Scm_tailcall(thunk, SCM_NULL, eval_state);
}
+/*============================================================================
+ SigScheme-Specific Non-R5RS Standard Procedures
+============================================================================*/
+#if SCM_USE_NONSTD_FEATURES
+/*
+ * TODO:
+ * - describe compatibility with de facto standard of other Scheme
+ * implementations (accept env as optional arg, etc)
+ */
+/* The implementation is fully compatible with SIOD */
+ScmObj ScmOp_symbol_boundp(ScmObj sym, ScmObj rest)
+{
+ ScmObj env = SCM_INVALID;
+ DECLARE_FUNCTION("symbol-bound?", ProcedureVariadic1);
+
+ ASSERT_SYMBOLP(sym);
+
+ env = POP_ARG(rest);
+ if (VALIDP(env))
+ ASSERT_ENVP(env);
+ else
+ env = SCM_INTERACTION_ENV;
+
+ return (!NULLP(Scm_LookupEnvironment(sym, env))
+ || SCM_SYMBOL_BOUNDP(sym)) ? SCM_TRUE : SCM_FALSE;
+}
+#endif /* SCM_USE_NONSTD_FEATURES */
+
#if SCM_USE_SRFI1
#include "operations-srfi1.c"
#endif
Modified: branches/r5rs/sigscheme/sigscheme.c
===================================================================
--- branches/r5rs/sigscheme/sigscheme.c 2005-10-03 22:47:45 UTC (rev 1786)
+++ branches/r5rs/sigscheme/sigscheme.c 2005-10-03 23:19:24 UTC (rev 1787)
@@ -367,6 +367,8 @@
Optional Syntaxes and Procedures
=======================================================================*/
#if SCM_USE_NONSTD_FEATURES
+ Scm_RegisterProcedureVariadic1("symbol-bound?" , ScmOp_symbol_boundp);
+
Scm_RegisterProcedureFixed1("require" , ScmOp_require);
Scm_RegisterProcedureFixed1("provide" , ScmOp_provide);
Scm_RegisterProcedureFixed1("provided?" , ScmOp_providedp);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-10-03 22:47:45 UTC (rev 1786)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-10-03 23:19:24 UTC (rev 1787)
@@ -510,6 +510,9 @@
ScmObj ScmOp_call_with_values(ScmObj producer, ScmObj consumer, ScmEvalState *eval_state);
ScmObj ScmOp_dynamic_wind(ScmObj before, ScmObj thunk, ScmObj after,
ScmEvalState *eval_state);
+#if SCM_USE_NONSTD_FEATURES
+ScmObj ScmOp_symbol_boundp(ScmObj sym, ScmObj rest);
+#endif
/* io.c */
void SigScm_set_lib_path(const char *path);
@@ -663,7 +666,6 @@
#if SCM_COMPAT_SIOD
/* operations-siod.c */
void SigScm_Initialize_SIOD(void);
-ScmObj ScmOp_symbol_boundp(ScmObj sym, ScmObj rest);
ScmObj ScmOp_symbol_value(ScmObj var);
ScmObj ScmOp_set_symbol_value(ScmObj var, ScmObj val);
ScmObj ScmOp_siod_eql(ScmObj obj1, ScmObj obj2);
More information about the uim-commit
mailing list