From bd93eaf7cc45d82c7b4ed13d648fd539a31a47b9 Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Thu, 4 Mar 2021 14:35:50 +0100 Subject: [PATCH] Add docstring for array-shape --- module/ice-9/boot-9.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index 126459d16..165fa2590 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -869,9 +869,19 @@ VALUE." ;;; {Arrays} ;;; -(define (array-shape a) +(define (array-shape array) + "Return a list as long as the rank of @var{array}, where each element +is a two-element list containing the lower and upper bounds of the +corresponding dimension. + +@lisp +(array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) (0 5)) +@end lisp + +See also: @code{array-dimensions}, @code{array-rank}." + (map (lambda (ind) (if (number? ind) (list 0 (+ -1 ind)) ind)) - (array-dimensions a))) + (array-dimensions array)))