[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/27: Remove the unused argument from scm_array_p
From: |
Daniel Llorens |
Subject: |
[Guile-commits] 04/27: Remove the unused argument from scm_array_p |
Date: |
Mon, 9 Mar 2020 05:30:30 -0400 (EDT) |
lloda pushed a commit to branch wip-vector-cleanup
in repository guile.
commit c44d82971290b157dbbe1d711fb3387add964b01
Author: Daniel Llorens <address@hidden>
AuthorDate: Mon Feb 3 13:24:03 2020 +0100
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.
---
NEWS-array-fixes.txt | 28 ++++++++++++++++++++++++++++
doc/ref/api-data.texi | 6 +-----
libguile/generalized-arrays.c | 13 ++-----------
libguile/generalized-arrays.h | 5 ++---
4 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/NEWS-array-fixes.txt b/NEWS-array-fixes.txt
new file mode 100644
index 0000000..6d97a52
--- /dev/null
+++ b/NEWS-array-fixes.txt
@@ -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.
+
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi
index 750f711..c70e3e2 100644
--- a/doc/ref/api-data.texi
+++ b/doc/ref/api-data.texi
@@ -7327,13 +7327,9 @@ values, one for each dimension.
@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
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
@deffn {Scheme Procedure} typed-array? obj type
diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c
index 28ca6b3..a48012f 100644
--- a/libguile/generalized-arrays.c
+++ b/libguile/generalized-arrays.c
@@ -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),
"Return @code{#t} if the @var{obj} is an array, and @code{#f} if\n"
"not.")
-#define FUNC_NAME s_scm_array_p_2
+#define FUNC_NAME s_scm_array_p
{
return scm_from_bool (scm_is_array (obj));
}
#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 130807b..5e7e981 100644
--- a/libguile/generalized-arrays.h
+++ b/libguile/generalized-arrays.h
@@ -35,7 +35,7 @@
#define SCM_VALIDATE_ARRAY(pos, v) \
do { \
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); \
} while (0)
@@ -43,8 +43,7 @@
/** Arrays */
SCM_API int scm_is_array (SCM obj);
-SCM_API SCM scm_array_p (SCM v, SCM unused);
-SCM_INTERNAL SCM scm_array_p_2 (SCM);
+SCM_API SCM scm_array_p (SCM v);
SCM_API int scm_is_typed_array (SCM obj, SCM type);
SCM_API SCM scm_typed_array_p (SCM v, SCM type);
- [Guile-commits] 07/27: Simplify interfaces to scm_bitvector_elements and scm_bitvector_writable_elements, (continued)
- [Guile-commits] 07/27: Simplify interfaces to scm_bitvector_elements and scm_bitvector_writable_elements, Daniel Llorens, 2020/03/09
- [Guile-commits] 13/27: Move bitvector functions using array_handle to libguile/array-handle.[ch], Daniel Llorens, 2020/03/09
- [Guile-commits] 14/27: Golf in srfi-4.h, Daniel Llorens, 2020/03/09
- [Guile-commits] 16/27: Pull generalized-vectors from under bitvector/string/vector, Daniel Llorens, 2020/03/09
- [Guile-commits] 15/27: Rewrite vector-copy! using memmove, Daniel Llorens, 2020/03/09
- [Guile-commits] 25/27: Remove superfluous type check in bitvector->list, Daniel Llorens, 2020/03/09
- [Guile-commits] 23/27: Remove 'contiguous' flag in arrays, Daniel Llorens, 2020/03/09
- [Guile-commits] 27/27: Reuse SCM_ASSERT_RANGE in scm_c_vector_ref, scm_c_vector_set_x, Daniel Llorens, 2020/03/09
- [Guile-commits] 21/27: Merge generalized-arrays.[ch] in arrays.[ch], Daniel Llorens, 2020/03/09
- [Guile-commits] 05/27: Simple vectors are just vectors, Daniel Llorens, 2020/03/09
- [Guile-commits] 04/27: Remove the unused argument from scm_array_p,
Daniel Llorens <=
- [Guile-commits] 18/27: Pull generalized-vectors from under bytevectors, Daniel Llorens, 2020/03/09
- [Guile-commits] 22/27: Remove scm_from_contiguous_typed_array, Daniel Llorens, 2020/03/09
- [Guile-commits] 24/27: Move uniform-array->bytevector from (rnrs bytevectors) to core, Daniel Llorens, 2020/03/09
- [Guile-commits] 26/27: Simplify vector constructor, Daniel Llorens, 2020/03/09
- [Guile-commits] 19/27: Remove generalized-vectors.[hc], Daniel Llorens, 2020/03/09