diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 3fa5ceda2..66e913e43 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,23 @@ +2001-01-24 Dirk Herrmann + + This patch was sent by Martin Grabmueller and makes sure that + parameter errors are reported correctly by the lexicographic + ordering predicates. + + * strorder.c (string_less_p, string_ci_less_p): New functions. + + (scm_string_less_p, scm_string_ci_less_p): Extracted the core + functionality into string_less_p, string_ci_less_p respectively. + The remaining code is just a wrapper to do the parameter + checking. + + (scm_string_leq_p, scm_string_gr_p, scm_string_geq_p): Check the + parameters and call string_less_p instead of scm_string_less_p. + + (scm_string_ci_leq_p, scm_string_ci_gr_p, scm_string_ci_geq_p): + Check the parameters and call string_less_ci_p instead of + scm_string_ci_less_p. + 2001-01-24 Dirk Herrmann This patch modifies scm_display_error to perform parameter diff --git a/libguile/strorder.c b/libguile/strorder.c index 815488a92..adea5de92 100644 --- a/libguile/strorder.c +++ b/libguile/strorder.c @@ -124,18 +124,14 @@ SCM_DEFINE1 (scm_string_ci_equal_p, "string-ci=?", scm_tc7_rpsubr, #undef FUNC_NAME -SCM_DEFINE1 (scm_string_less_p, "string?", scm_tc7_rpsubr, "is lexicographically greater than @var{s2}. (r5rs)") #define FUNC_NAME s_scm_string_gr_p { - return scm_string_less_p (s2, s1); + SCM_VALIDATE_STRING (1, s1); + SCM_VALIDATE_STRING (2, s2); + + return string_less_p (s2, s1); } #undef FUNC_NAME @@ -181,24 +196,22 @@ SCM_DEFINE1 (scm_string_geq_p, "string>=?", scm_tc7_rpsubr, "is lexicographically greater than or equal to @var{s2}. (r5rs)") #define FUNC_NAME s_scm_string_geq_p { - return SCM_BOOL_NOT (scm_string_less_p (s1, s2)); + SCM_VALIDATE_STRING (1, s1); + SCM_VALIDATE_STRING (2, s2); + + return SCM_BOOL_NOT (string_less_p (s1, s2)); } #undef FUNC_NAME -SCM_DEFINE1 (scm_string_ci_less_p, "string-ci?", scm_tc7_rpsubr, "@var{s2} regardless of case. (r5rs)") #define FUNC_NAME s_scm_string_ci_gr_p { - return scm_string_ci_less_p (s2, s1); + SCM_VALIDATE_STRING (1, s1); + SCM_VALIDATE_STRING (2, s2); + + return string_ci_less_p (s2, s1); } #undef FUNC_NAME @@ -247,7 +280,10 @@ SCM_DEFINE1 (scm_string_ci_geq_p, "string-ci>=?", scm_tc7_rpsubr, "or equal to @var{s2} regardless of case. (r5rs)") #define FUNC_NAME s_scm_string_ci_geq_p { - return SCM_BOOL_NOT (scm_string_ci_less_p (s1, s2)); + SCM_VALIDATE_STRING (1, s1); + SCM_VALIDATE_STRING (2, s2); + + return SCM_BOOL_NOT (string_ci_less_p (s1, s2)); } #undef FUNC_NAME