1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Add docstring for array-shape

This commit is contained in:
Daniel Llorens 2021-03-04 14:35:50 +01:00
parent d904392885
commit bd93eaf7cc

View file

@ -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)))