summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Llorens <lloda@sarc.name>2021-03-04 14:35:50 +0100
committerDaniel Llorens <lloda@sarc.name>2021-03-04 14:35:50 +0100
commitbd93eaf7cc45d82c7b4ed13d648fd539a31a47b9 (patch)
treeb8d9c73969d49a6c861ac3fcda26858d09b1c912
parentd904392885517296ad68e915b4f11c19388559f1 (diff)
downloadguile-bd93eaf7cc45d82c7b4ed13d648fd539a31a47b9.tar.gz
Add docstring for array-shape
-rw-r--r--module/ice-9/boot-9.scm14
1 files 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)))