summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--libguile/ChangeLog16
-rw-r--r--libguile/__scm.h10
-rw-r--r--libguile/backtrace.c2
-rw-r--r--libguile/debug.c7
-rw-r--r--libguile/eval.c18
-rw-r--r--libguile/feature.c5
-rw-r--r--libguile/gsubr.c2
-rw-r--r--libguile/numbers.c19
-rw-r--r--libguile/srcprop.c18
10 files changed, 30 insertions, 72 deletions
diff --git a/NEWS b/NEWS
index 68431fd3e..2a72b62b6 100644
--- a/NEWS
+++ b/NEWS
@@ -173,6 +173,11 @@ Now, caching of local variable positions during memoization is mandatory.
However, the option to disable the caching has most probably not been used
anyway.
+** Removed compile time option SCM_RECKLESS
+
+Full number of arguments checking of closures is mandatory now. However, the
+option to disable the checking has most probably not been used anyway.
+
** Removed definitions: scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify,
s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify,
scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated,
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 85cffcba1..60f5026ec 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,19 @@
+2002-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
+ * backtrace.c (SCM_ASSERT), debug.c (scm_debug_options), eval.c
+ (scm_lookupcar, scm_lookupcar1, scm_badargsp, SCM_CEVAL,
+ SCM_APPLY, scm_map, scm_for_each), feature.c (scm_init_feature),
+ gsubr.c (scm_gsubr_apply), numbers.c (scm_logand, scm_logior,
+ scm_logxor, scm_i_dbl2big), srcprop.c (scm_source_properties,
+ scm_set_source_properties_x, scm_source_property): Removed
+ compile time option SCM_RECKLESS to clean up the code. Full
+ number of arguments checking of closures is mandatory now.
+ However, the option to disable the checking has most probably not
+ been used anyway.
+
+ * srcprop.c (scm_source_properties, scm_set_source_properties_x,
+ scm_source_property): Use !SCM_CONSP instead of SCM_NCONSP.
+
2002-06-30 Gary Houston <ghouston@arglist.com>
* dynl.c: Removed all SCM_DEFER_INTS/SCM_ALLOW_INTS, which won't
diff --git a/libguile/__scm.h b/libguile/__scm.h
index b437f6d5b..c91908700 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -100,16 +100,8 @@
/* #define GUILE_DEBUG_FREELIST */
/* If the compile FLAG `SCM_CAUTIOUS' is #defined then the number of
- * arguments is always checked for application of closures. If the
- * compile FLAG `SCM_RECKLESS' is #defined then they are not checked.
- * Otherwise, number of argument checks for closures are made only
- * when the function position (whose value is the closure) of a
- * combination is not an ILOC or a variable (true?). When the
- * function position of a combination is a symbol it will be checked
- * only the first time it is evaluated because it will then be
- * replaced with an ILOC or variable.
+ * arguments is always checked for application of closures.
*/
-#undef SCM_RECKLESS
#define SCM_CAUTIOUS
/* All the number support there is.
diff --git a/libguile/backtrace.c b/libguile/backtrace.c
index 568e2b9f3..6c707ac90 100644
--- a/libguile/backtrace.c
+++ b/libguile/backtrace.c
@@ -77,12 +77,10 @@
* Note that these functions shouldn't generate errors themselves.
*/
-#ifndef SCM_RECKLESS
#undef SCM_ASSERT
#define SCM_ASSERT(_cond, _arg, _pos, _subr) \
if (!(_cond)) \
return SCM_BOOL_F;
-#endif
SCM scm_the_last_stack_fluid_var;
diff --git a/libguile/debug.c b/libguile/debug.c
index a7e2e9932..05c0cf3bd 100644
--- a/libguile/debug.c
+++ b/libguile/debug.c
@@ -81,17 +81,12 @@ SCM_DEFINE (scm_debug_options, "debug-options-interface", 0, 1, 0,
{
SCM ans;
SCM_DEFER_INTS;
- ans = scm_options (setting,
- scm_debug_opts,
- SCM_N_DEBUG_OPTIONS,
- FUNC_NAME);
-#ifndef SCM_RECKLESS
+ ans = scm_options (setting, scm_debug_opts, SCM_N_DEBUG_OPTIONS, FUNC_NAME);
if (!(1 <= SCM_N_FRAMES && SCM_N_FRAMES <= SCM_MAX_FRAME_SIZE))
{
scm_options (ans, scm_debug_opts, SCM_N_DEBUG_OPTIONS, FUNC_NAME);
SCM_OUT_OF_RANGE (1, setting);
}
-#endif
SCM_RESET_DEBUG_MODE;
scm_stack_checking_enabled_p = SCM_STACK_CHECKING_P;
scm_debug_eframe_size = 2 * SCM_N_FRAMES;
diff --git a/libguile/eval.c b/libguile/eval.c
index a41a16a21..cadb66727 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -281,13 +281,11 @@ scm_lookupcar (SCM vloc, SCM genv, int check)
al = SCM_CDRLOC (*al);
if (SCM_EQ_P (SCM_CAR (fl), var))
{
-#ifndef SCM_RECKLESS /* letrec inits to SCM_UNDEFINED */
if (SCM_UNBNDP (SCM_CAR (*al)))
{
env = SCM_EOL;
goto errout;
}
-#endif
#ifdef USE_THREADS
if (!SCM_EQ_P (SCM_CAR (vloc), var))
goto race;
@@ -313,7 +311,6 @@ scm_lookupcar (SCM vloc, SCM genv, int check)
if (SCM_FALSEP (real_var))
goto errout;
-#ifndef SCM_RECKLESS
if (!SCM_NULLP (env) || SCM_UNBNDP (SCM_VARIABLE_REF (real_var)))
{
errout:
@@ -335,7 +332,6 @@ scm_lookupcar (SCM vloc, SCM genv, int check)
return &undef_object;
}
}
-#endif
#ifdef USE_THREADS
if (!SCM_EQ_P (SCM_CAR (vloc), var))
@@ -1540,7 +1536,6 @@ scm_unmemocopy (SCM x, SCM env)
return unmemocopy (x, env);
}
-#ifndef SCM_RECKLESS
int
scm_badargsp (SCM formals, SCM args)
@@ -1557,7 +1552,6 @@ scm_badargsp (SCM formals, SCM args)
return !SCM_NULLP (args) ? 1 : 0;
}
-#endif
static int
scm_badformalsp (SCM closure, int n)
@@ -2339,10 +2333,8 @@ dispatch:
#ifdef DEVAL
debug.info->a.args = arg1;
#endif
-#ifndef SCM_RECKLESS
if (scm_badargsp (formals, arg1))
scm_wrong_num_args (proc);
-#endif
ENTER_APPLY;
/* Copy argument list */
if (SCM_NULL_OR_NIL_P (arg1))
@@ -2697,11 +2689,9 @@ dispatch:
case SCM_BIT8(SCM_ILOC00):
proc = *scm_ilookup (SCM_CAR (x), env);
SCM_ASRTGO (SCM_NIMP (proc), badfun);
-#ifndef SCM_RECKLESS
#ifdef SCM_CAUTIOUS
goto checkargs;
#endif
-#endif
break;
case scm_tcs_cons_nimcar:
@@ -2786,7 +2776,6 @@ dispatch:
else
proc = SCM_CEVAL (SCM_CAR (x), env);
SCM_ASRTGO (!SCM_IMP (proc), badfun);
-#ifndef SCM_RECKLESS
#ifdef SCM_CAUTIOUS
checkargs:
#endif
@@ -2808,7 +2797,6 @@ dispatch:
}
else if (SCM_MACROP (proc))
goto handle_a_macro;
-#endif
}
@@ -3663,10 +3651,8 @@ tail:
#else
arg1 = (SCM_UNBNDP (arg1) ? SCM_EOL : scm_cons (arg1, args));
#endif
-#ifndef SCM_RECKLESS
if (scm_badargsp (SCM_CLOSURE_FORMALS (proc), arg1))
scm_wrong_num_args (proc);
-#endif
/* Copy argument list */
if (SCM_IMP (arg1))
@@ -3877,9 +3863,7 @@ scm_map (SCM proc, SCM arg1, SCM args)
}
args = scm_vector (arg1 = scm_cons (arg1, args));
ve = SCM_VELTS (args);
-#ifndef SCM_RECKLESS
check_map_args (args, len, g_map, proc, arg1, s_map);
-#endif
while (1)
{
arg1 = SCM_EOL;
@@ -3920,9 +3904,7 @@ scm_for_each (SCM proc, SCM arg1, SCM args)
}
args = scm_vector (arg1 = scm_cons (arg1, args));
ve = SCM_VELTS (args);
-#ifndef SCM_RECKLESS
check_map_args (args, len, g_for_each, proc, arg1, s_for_each);
-#endif
while (1)
{
arg1 = SCM_EOL;
diff --git a/libguile/feature.c b/libguile/feature.c
index 8e71676c2..9a9bdc303 100644
--- a/libguile/feature.c
+++ b/libguile/feature.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -102,9 +102,6 @@ void
scm_init_feature()
{
features_var = scm_c_define ("*features*", SCM_EOL);
-#ifdef SCM_RECKLESS
- scm_add_feature("reckless");
-#endif
#ifndef _Windows
scm_add_feature("system");
#endif
diff --git a/libguile/gsubr.c b/libguile/gsubr.c
index b8b15462f..42af8ad76 100644
--- a/libguile/gsubr.c
+++ b/libguile/gsubr.c
@@ -223,10 +223,8 @@ scm_gsubr_apply (SCM args)
#endif
args = SCM_CDR (args);
for (i = 0; i < SCM_GSUBR_REQ (typ); i++) {
-#ifndef SCM_RECKLESS
if (SCM_NULLP (args))
scm_wrong_num_args (SCM_SNAME (SCM_GSUBR_PROC (self)));
-#endif
v[i] = SCM_CAR(args);
args = SCM_CDR(args);
}
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 31dfb33fc..d3d8eca2e 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
*
* Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories
* and Bellcore. See scm_divide.
@@ -898,15 +898,10 @@ SCM_DEFINE1 (scm_logand, "logand", scm_tc7_asubr,
return SCM_MAKINUM (-1);
} else if (!SCM_NUMBERP (n1)) {
SCM_WRONG_TYPE_ARG (SCM_ARG1, n1);
-#ifndef SCM_RECKLESS
} else if (SCM_NUMBERP (n1)) {
return n1;
} else {
SCM_WRONG_TYPE_ARG (SCM_ARG1, n1);
-#else
- } else {
- return n1;
-#endif
}
}
@@ -982,15 +977,10 @@ SCM_DEFINE1 (scm_logior, "logior", scm_tc7_asubr,
if (SCM_UNBNDP (n2)) {
if (SCM_UNBNDP (n1)) {
return SCM_INUM0;
-#ifndef SCM_RECKLESS
} else if (SCM_NUMBERP (n1)) {
return n1;
} else {
SCM_WRONG_TYPE_ARG (SCM_ARG1, n1);
-#else
- } else {
- return n1;
-#endif
}
}
@@ -1069,15 +1059,10 @@ SCM_DEFINE1 (scm_logxor, "logxor", scm_tc7_asubr,
if (SCM_UNBNDP (n2)) {
if (SCM_UNBNDP (n1)) {
return SCM_INUM0;
-#ifndef SCM_RECKLESS
} else if (SCM_NUMBERP (n1)) {
return n1;
} else {
SCM_WRONG_TYPE_ARG (SCM_ARG1, n1);
-#else
- } else {
- return n1;
-#endif
}
}
@@ -4537,10 +4522,8 @@ scm_i_dbl2big (double d)
u -= c;
digits[i] = c;
}
-#ifndef SCM_RECKLESS
if (u != 0)
scm_num_overflow ("dbl2big");
-#endif
return ans;
}
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index ae18babf2..3c679d3bd 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -182,10 +182,8 @@ SCM_DEFINE (scm_source_properties, "source-properties", 1, 0, 0,
SCM_VALIDATE_NIM (1,obj);
if (SCM_MEMOIZEDP (obj))
obj = SCM_MEMOIZED_EXP (obj);
-#ifndef SCM_RECKLESS
- else if (SCM_NCONSP (obj))
+ else if (!SCM_CONSP (obj))
SCM_WRONG_TYPE_ARG (1, obj);
-#endif
p = scm_hashq_ref (scm_source_whash, obj, SCM_BOOL_F);
if (SRCPROPSP (p))
return scm_srcprops_to_plist (p);
@@ -205,10 +203,8 @@ SCM_DEFINE (scm_set_source_properties_x, "set-source-properties!", 2, 0, 0,
SCM_VALIDATE_NIM (1,obj);
if (SCM_MEMOIZEDP (obj))
obj = SCM_MEMOIZED_EXP (obj);
-#ifndef SCM_RECKLESS
- else if (SCM_NCONSP (obj))
+ else if (!SCM_CONSP (obj))
SCM_WRONG_TYPE_ARG(1, obj);
-#endif
handle = scm_hashq_create_handle_x (scm_source_whash, obj, plist);
SCM_SETCDR (handle, plist);
return plist;
@@ -225,10 +221,8 @@ SCM_DEFINE (scm_source_property, "source-property", 2, 0, 0,
SCM_VALIDATE_NIM (1,obj);
if (SCM_MEMOIZEDP (obj))
obj = SCM_MEMOIZED_EXP (obj);
-#ifndef SCM_RECKLESS
- else if (SCM_NCONSP (obj))
+ else if (!SCM_CONSP (obj))
SCM_WRONG_TYPE_ARG (1, obj);
-#endif
p = scm_hashq_ref (scm_source_whash, obj, SCM_EOL);
if (!SRCPROPSP (p))
goto plist;
@@ -259,10 +253,8 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0,
SCM_VALIDATE_NIM (1,obj);
if (SCM_MEMOIZEDP (obj))
obj = SCM_MEMOIZED_EXP (obj);
-#ifndef SCM_RECKLESS
- else if (SCM_NCONSP (obj))
+ else if (!SCM_CONSP (obj))
SCM_WRONG_TYPE_ARG (1, obj);
-#endif
h = scm_whash_get_handle (scm_source_whash, obj);
if (SCM_WHASHFOUNDP (h))
p = SCM_WHASHREF (scm_source_whash, h);