From ec370c6ffb560a718280e906c193dcc912923059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 23 Sep 2009 22:04:55 +0200 Subject: [PATCH] Reinstate backward-compatible `scm_array_p ()'. * libguile/generalized-arrays.c (scm_array_p_2): New, formerly `scm_array_p ()'. (scm_array_p): Add second argument, for compatibility with 1.8 and earlier and to match what the doc says and what `SCM_VALIDATE_ARRAY' expects. * libguile/generalized-arrays.h (scm_array_p_2): New. (scm_array_p): Adjust. --- libguile/generalized-arrays.c | 14 ++++++++++++-- libguile/generalized-arrays.h | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c index 6394405dd..13f66fdca 100644 --- a/libguile/generalized-arrays.c +++ b/libguile/generalized-arrays.c @@ -39,8 +39,8 @@ scm_is_array (SCM obj) return scm_i_array_implementation_for_obj (obj) ? 1 : 0; } -SCM_DEFINE (scm_array_p, "array?", 1, 0, 0, - (SCM obj), +SCM_DEFINE (scm_array_p_2, "array?", 1, 0, 0, + (SCM obj), "Return @code{#t} if the @var{obj} is an array, and @code{#f} if\n" "not.") #define FUNC_NAME s_scm_array_p @@ -49,6 +49,16 @@ SCM_DEFINE (scm_array_p, "array?", 1, 0, 0, } #undef FUNC_NAME +/* The array type predicate, with an extra argument kept for backward + compatibility. Note that we can't use `SCM_DEFINE' directly because there + would be an argument count mismatch that would be caught by + `snarf-check-and-output-texi.scm'. */ +SCM +scm_array_p (SCM obj, SCM unused) +{ + return scm_array_p_2 (obj); +} + int scm_is_typed_array (SCM obj, SCM type) { diff --git a/libguile/generalized-arrays.h b/libguile/generalized-arrays.h index cc7214e8b..1f9b6ad3d 100644 --- a/libguile/generalized-arrays.h +++ b/libguile/generalized-arrays.h @@ -35,7 +35,8 @@ /** Arrays */ SCM_API int scm_is_array (SCM obj); -SCM_API SCM scm_array_p (SCM v); +SCM_API SCM scm_array_p (SCM v, SCM unused); +SCM_INTERNAL SCM scm_array_p_2 (SCM); SCM_API int scm_is_typed_array (SCM obj, SCM type); SCM_API SCM scm_typed_array_p (SCM v, SCM type);