Handbook
Glossary
ndim ( array -- n )
Vocabulary
arrays
.
shaped
Inputs
array
a
shaped-array
, a
sequence
, or a
number
Outputs
n
an
integer
Word description
Returns the number of dimensions of a shaped array or a rectangular nested sequence. Numbers have zero dimensions. An empty ordinary sequence has one dimension.
Definition
USING:
accessors
kernel
sequences
;
IN:
arrays.shaped
:
ndim
( array -- n )
shape
dup
uniform-shape?
[
shape>>
]
when
length
;