1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 15:40:38 +02:00

Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_x

This commit is contained in:
Daniel Llorens 2015-02-11 19:32:02 +01:00
parent ecb38d4268
commit 3aafc2c857
4 changed files with 25 additions and 23 deletions

View file

@ -431,7 +431,7 @@ SCM_DEFINE (scm_array_from_s, "array-from*", 1, 0, 1,
(SCM ra, SCM indices),
"Return the array slice @var{ra}[@var{indices} ..., ...]\n"
"The rank of @var{ra} must equal to the number of indices or larger.\n\n"
"See also @code{array-ref}, @code{array-from}, @code{array-set-from!}.\n\n"
"See also @code{array-ref}, @code{array-from}, @code{array-amend!}.\n\n"
"@code{array-from*} may return a rank-0 array. For example:\n"
"@lisp\n"
"(array-from* #2((1 2 3) (4 5 6)) 1 1) @result{} #0(5)\n"
@ -463,7 +463,7 @@ SCM_DEFINE (scm_array_from, "array-from", 1, 0, 1,
"Return the element at the @code{(@var{indices} ...)} position\n"
"in array @var{ra}, or the array slice @var{ra}[@var{indices} ..., ...]\n"
"if the rank of @var{ra} is larger than the number of indices.\n\n"
"See also @code{array-ref}, @code{array-from*}, @code{array-set-from!}.\n\n"
"See also @code{array-ref}, @code{array-from*}, @code{array-amend!}.\n\n"
"@code{array-from} never returns a rank 0 array. For example:\n"
"@lisp\n"
"(array-from #2((1 2 3) (4 5 6)) 1 1) @result{} 5\n"
@ -495,7 +495,7 @@ SCM_DEFINE (scm_array_from, "array-from", 1, 0, 1,
#undef FUNC_NAME
SCM_DEFINE (scm_array_set_from_x, "array-set-from!", 2, 0, 1,
SCM_DEFINE (scm_array_amend_x, "array-amend!", 2, 0, 1,
(SCM ra, SCM b, SCM indices),
"Set the array slice @var{ra}[@var{indices} ..., ...] to @var{b}\n."
"Equivalent to @code{(array-copy! @var{b} (apply array-from @var{ra} @var{indices}))}\n"
@ -506,14 +506,14 @@ SCM_DEFINE (scm_array_set_from_x, "array-set-from!", 2, 0, 1,
"For example:\n"
"@lisp\n"
"(define A (list->array 2 '((1 2 3) (4 5 6))))\n"
"(array-set-from! A #0(99) 1 1) @result{} #2((1 2 3) (4 #0(99) 6))\n"
"(array-set-from! A 99 1 1) @result{} #2((1 2 3) (4 99 6))\n"
"(array-set-from! A #(a b c) 0) @result{} #2((a b c) (4 99 6))\n"
"(array-set-from! A #2((x y z) (9 8 7))) @result{} #2((x y z) (9 8 7))\n\n"
"(array-amend! A #0(99) 1 1) @result{} #2((1 2 3) (4 #0(99) 6))\n"
"(array-amend! A 99 1 1) @result{} #2((1 2 3) (4 99 6))\n"
"(array-amend! A #(a b c) 0) @result{} #2((a b c) (4 99 6))\n"
"(array-amend! A #2((x y z) (9 8 7))) @result{} #2((x y z) (9 8 7))\n\n"
"(define B (make-array 0))\n"
"(array-set-from! B 15) @result{} #0(15)\n"
"(array-amend! B 15) @result{} #0(15)\n"
"@end lisp")
#define FUNC_NAME s_scm_array_set_from_x
#define FUNC_NAME s_scm_array_amend_x
{
ARRAY_FROM_POS(scm_list_3 (ra, b, indices))
SCM o;