[uim-commit] r2993 - branches/r5rs/sigscheme/src
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Jan 25 20:42:41 PST 2006
Author: yamaken
Date: 2006-01-25 20:42:36 -0800 (Wed, 25 Jan 2006)
New Revision: 2993
Modified:
branches/r5rs/sigscheme/src/config.h
branches/r5rs/sigscheme/src/eval.c
Log:
* sigscheme/src/config.h
- (SCM_STRICT_NULL_FORM, SCM_STRICT_VECTOR_FORM): New macro
- Add dependency resolution for SCM_STRICT_R5RS
* sigscheme/src/eval.c
- (scm_eval):
* Add #() rejection for SCM_STRICT_VECTOR_FORM
* Replace SCM_STRICT_R5RS for () rejection with
SCM_STRICT_NULL_FORM
Modified: branches/r5rs/sigscheme/src/config.h
===================================================================
--- branches/r5rs/sigscheme/src/config.h 2006-01-26 03:14:15 UTC (rev 2992)
+++ branches/r5rs/sigscheme/src/config.h 2006-01-26 04:42:36 UTC (rev 2993)
@@ -81,6 +81,8 @@
Internal Behaviors
===========================================================================*/
#define SCM_STRICT_R5RS 0 /* use strict R5RS check */
+#define SCM_STRICT_NULL_FORM 0 /* disallow quote-less () */
+#define SCM_STRICT_VECTOR_FORM 0 /* disallow quote-less vector literal */
#define SCM_STRICT_ARGCHECK 1 /* enable strict argument check */
#define SCM_STRICT_DEFINE_PLACEMENT 1 /* enable strict check on internal definitions */
#define SCM_STRICT_ENCODING_CHECK 1 /* do all feasible encoding error checks */
@@ -151,6 +153,17 @@
#error "Don't enable dangerous SCM_USE_NULL_CAPABLE_STRING for production code"
#endif
+#if SCM_STRICT_R5RS
+#undef SCM_STRICT_NULL_FORM
+#define SCM_STRICT_NULL_FORM 1
+#undef SCM_STRICT_VECTOR_FORM
+#define SCM_STRICT_VECTOR_FORM 1
+#undef SCM_STRICT_ARGCHECK
+#define SCM_STRICT_ARGCHECK 1
+#undef SCM_STRICT_DEFINE_PLACEMENT
+#define SCM_STRICT_DEFINE_PLACEMENT 1
+#endif /* SCM_STRICT_R5RS */
+
#if SCM_COMPAT_SIOD
#undef SCM_USE_NONSTD_FEATURES
#define SCM_USE_NONSTD_FEATURES 1
Modified: branches/r5rs/sigscheme/src/eval.c
===================================================================
--- branches/r5rs/sigscheme/src/eval.c 2006-01-26 03:14:15 UTC (rev 2992)
+++ branches/r5rs/sigscheme/src/eval.c 2006-01-26 04:42:36 UTC (rev 2993)
@@ -412,11 +412,15 @@
if (state.ret_type == SCM_VALTYPE_NEED_EVAL)
goto eval_loop;
}
-#if SCM_STRICT_R5RS
+#if SCM_STRICT_NULL_FORM
/* () is allowed by default for efficiency */
else if (NULLP(obj))
ERR("eval: () is not a valid R5RS form. use '() instead");
#endif
+#if SCM_STRICT_VECTOR_FORM
+ else if (VECTORP(obj))
+ ERR("eval: #() is not a valid R5RS form. use '#() instead");
+#endif
#if SCM_DEBUG
scm_pop_trace_frame();
More information about the uim-commit
mailing list