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:
parent
d904392885
commit
bd93eaf7cc
1 changed files with 12 additions and 2 deletions
|
@ -869,9 +869,19 @@ VALUE."
|
||||||
;;; {Arrays}
|
;;; {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))
|
(map (lambda (ind) (if (number? ind) (list 0 (+ -1 ind)) ind))
|
||||||
(array-dimensions a)))
|
(array-dimensions array)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue