summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/ChangeLog11
-rw-r--r--libguile/__scm.h21
-rw-r--r--libguile/eval.c7
3 files changed, 29 insertions, 10 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index d0b2c2b9d..1efa6da8d 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,12 @@
+2000-05-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
+ * __scm.h: Added SCM_DEBUG as default debug option. (Thanks to
+ Keisuke Nishida for the suggestion.) Added debug option
+ SCM_DEBUG_REST_ARGUMENTS.
+
+ * eval.c (scm_map, scm_for_each): Make sure all lists have the
+ same length. Also, removed redundant parameter checks.
+
2000-05-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
* Makefile.am: Let 'make clean' remove *.x and *.doc files.
@@ -26,7 +35,7 @@
* stime.c (scm_strftime): don't reset TZ if zone is an empty
string. append a "0" to the zone for TZ.
-
+
2000-05-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
* numbers.c (scm_logbit_p, scm_bit_extract): Reordered dispatch
diff --git a/libguile/__scm.h b/libguile/__scm.h
index da510f385..6572fd979 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -152,18 +152,35 @@
*/
+/* The value of SCM_DEBUG determines the default for most of the not yet
+ * defined debugging options. This allows, for example, to enable most of the
+ * debugging options by simply defining SCM_DEBUG as 1.
+ */
+#ifndef SCM_DEBUG
+#define SCM_DEBUG 0
+#endif
+
/* If SCM_DEBUG_DEPRECATED is set to 1, deprecated code is not compiled. This
* can be used by developers to get rid of references to deprecated code.
*/
#ifndef SCM_DEBUG_DEPRECATED
-#define SCM_DEBUG_DEPRECATED 0
+#define SCM_DEBUG_DEPRECATED SCM_DEBUG
+#endif
+
+/* If SCM_DEBUG_REST_ARGUMENTS is set to 1, functions that take rest arguments
+ * will check whether the rest arguments actually form a proper list.
+ * Otherwise it is assumed that the rest arguments form a proper list and only
+ * the parameters themselves, which are given as rest arguments, are checked.
+ */
+#ifndef SCM_DEBUG_REST_ARGUMENTS
+#define SCM_DEBUG_REST_ARGUMENTS SCM_DEBUG
#endif
/* Use this for _compile time_ type checking only, since the compiled result
* will be quite inefficient. The right way to make use of this option is to
* do a 'make clean; make CFLAGS=-DSCM_DEBUG_TYPING_STRICTNESS=1', fix your
* errors, and then do 'make clean; make'.
-*/
+ */
#ifndef SCM_DEBUG_TYPING_STRICTNESS
#define SCM_DEBUG_TYPING_STRICTNESS 0
#endif
diff --git a/libguile/eval.c b/libguile/eval.c
index 91009fc24..0fa22172c 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -3581,8 +3581,6 @@ scm_map (SCM proc, SCM arg1, SCM args)
SCM *pres = &res;
SCM *ve = &args; /* Keep args from being optimized away. */
- if (SCM_NULLP (arg1))
- return res;
len = scm_ilength (arg1);
SCM_GASSERTn (len >= 0,
g_map, scm_cons2 (proc, arg1, args), SCM_ARG2, s_map);
@@ -3590,7 +3588,6 @@ scm_map (SCM proc, SCM arg1, SCM args)
{
while (SCM_NIMP (arg1))
{
- SCM_GASSERT2 (SCM_CONSP (arg1), g_map, proc, arg1, SCM_ARG2, s_map);
*pres = scm_cons (scm_apply (proc, SCM_CAR (arg1), scm_listofnull),
SCM_EOL);
pres = SCM_CDRLOC (*pres);
@@ -3626,8 +3623,6 @@ scm_for_each (SCM proc, SCM arg1, SCM args)
{
SCM *ve = &args; /* Keep args from being optimized away. */
long i, len;
- if SCM_NULLP (arg1)
- return SCM_UNSPECIFIED;
len = scm_ilength (arg1);
SCM_GASSERTn (len >= 0, g_for_each, scm_cons2 (proc, arg1, args),
SCM_ARG2, s_for_each);
@@ -3635,8 +3630,6 @@ scm_for_each (SCM proc, SCM arg1, SCM args)
{
while SCM_NIMP (arg1)
{
- SCM_GASSERT2 (SCM_CONSP (arg1),
- g_for_each, proc, arg1, SCM_ARG2, s_for_each);
scm_apply (proc, SCM_CAR (arg1), scm_listofnull);
arg1 = SCM_CDR (arg1);
}