1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-11 16:20:19 +02:00

Remove the unused argument from scm_array_p

* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c: As stated.
* doc/ref/api-data.texi: Fix documentation.
* NEWS-array-fixes.txt: Document branch changes.
This commit is contained in:
Daniel Llorens 2020-02-03 13:24:03 +01:00
parent 996bbb47f2
commit 6c97c8108e
4 changed files with 33 additions and 19 deletions

28
NEWS-array-fixes.txt Normal file
View file

@ -0,0 +1,28 @@
TBA to NEWS for this branch.
* Forward incompatible changes
Applying these changes will make your program work with this version of
Guile and continue working with older versions.
** vector->list and vector-copy require a true vector argument.
Use array->list and array-copy (from (ice-9 arrays)) on general arrays.
** scm_vector_elements / scm_vector_writable_elements require a true vector argument.
Use scm_array_get_handle and scm_array_handle_elements /
scm_array_handle_writable_elements on general arrays.
* Backward incompatible changes
Applying these changes will make your program work with this version of
Guile and STOP working with older versions.
** scm_array_p takes a single argument.
This function used to take a second unused argument for the sake of
compatibility with older versions of Guile. Just remove this argument from your
calls.

View file

@ -7327,13 +7327,9 @@ values, one for each dimension.
@deffn {Scheme Procedure} array? obj @deffn {Scheme Procedure} array? obj
@deffnx {C Function} scm_array_p (obj, unused) @deffnx {C Function} scm_array_p (obj)
Return @code{#t} if the @var{obj} is an array, and @code{#f} if Return @code{#t} if the @var{obj} is an array, and @code{#f} if
not. not.
The second argument to scm_array_p is there for historical reasons,
but it is not used. You should always pass @code{SCM_UNDEFINED} as
its value.
@end deffn @end deffn
@deffn {Scheme Procedure} typed-array? obj type @deffn {Scheme Procedure} typed-array? obj type

View file

@ -62,25 +62,16 @@ scm_is_array (SCM obj)
} }
} }
SCM_DEFINE (scm_array_p_2, "array?", 1, 0, 0, SCM_DEFINE (scm_array_p, "array?", 1, 0, 0,
(SCM obj), (SCM obj),
"Return @code{#t} if the @var{obj} is an array, and @code{#f} if\n" "Return @code{#t} if the @var{obj} is an array, and @code{#f} if\n"
"not.") "not.")
#define FUNC_NAME s_scm_array_p_2 #define FUNC_NAME s_scm_array_p
{ {
return scm_from_bool (scm_is_array (obj)); return scm_from_bool (scm_is_array (obj));
} }
#undef FUNC_NAME #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 int
scm_is_typed_array (SCM obj, SCM type) scm_is_typed_array (SCM obj, SCM type)

View file

@ -35,7 +35,7 @@
#define SCM_VALIDATE_ARRAY(pos, v) \ #define SCM_VALIDATE_ARRAY(pos, v) \
do { \ do { \
SCM_ASSERT (SCM_HEAP_OBJECT_P (v) \ SCM_ASSERT (SCM_HEAP_OBJECT_P (v) \
&& scm_is_true (scm_array_p (v, SCM_UNDEFINED)), \ && scm_is_true (scm_array_p (v)), \
v, pos, FUNC_NAME); \ v, pos, FUNC_NAME); \
} while (0) } while (0)
@ -43,8 +43,7 @@
/** Arrays */ /** Arrays */
SCM_API int scm_is_array (SCM obj); SCM_API int scm_is_array (SCM obj);
SCM_API SCM scm_array_p (SCM v, SCM unused); SCM_API SCM scm_array_p (SCM v);
SCM_INTERNAL SCM scm_array_p_2 (SCM);
SCM_API int scm_is_typed_array (SCM obj, SCM type); SCM_API int scm_is_typed_array (SCM obj, SCM type);
SCM_API SCM scm_typed_array_p (SCM v, SCM type); SCM_API SCM scm_typed_array_p (SCM v, SCM type);