From 6be51f9bbf47692ee5747b2cac6b372df65de970 Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Thu, 21 Oct 2021 15:05:46 +0200 Subject: Provide xxvector-copy and xxvector-copy! for srfi-4 vectors These use the argument conventions of vector-copy!, string-copy!, etc. and not that of bytevector-copy! (which is from r6rs). * module/srfi/srfi-4/gnu.scm: As stated. * test-suite/tests/srfi-4.test: Tests. * doc/ref/srfi-modules.texi: Documentation. * libguile/bytevectors.c (bytevector-copy!): Add overlap note to docstring. * libguile/vectors.c (vector-copy!): Reuse text for the overlap note. --- libguile/bytevectors.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libguile/bytevectors.c') diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index 5bb1c8d49..f42fbb427 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -609,9 +609,13 @@ SCM_DEFINE (scm_bytevector_copy_x, "bytevector-copy!", 5, 0, 0, (SCM source, SCM source_start, SCM target, SCM target_start, SCM len), "Copy @var{len} bytes from @var{source} into @var{target}, " - "starting reading from @var{source_start} (a positive index " - "within @var{source}) and start writing at " - "@var{target_start}.") + "reading from a block starting at @var{source_start} (a positive " + "index within @var{source}) and writing to a block starting at " + "@var{target_start}.\n\n" + "It is permitted for the @var{source} and @var{target} regions to " + "overlap. In that case, copying takes place as if the source is " + "first copied into a temporary bytevector and then into the " + "destination. ") #define FUNC_NAME s_scm_bytevector_copy_x { size_t c_len, c_source_len, c_target_len; -- cgit v1.2.3