Handbook
Glossary
nest-shaped ( underlying shape -- array )
Vocabulary
arrays
.
shaped
.
private
Inputs
underlying
an
object
shape
an
object
Outputs
array
an
object
Definition
USING:
arrays
kernel
math
sequences
;
IN:
arrays.shaped.private
::
nest-shaped
( underlying shape -- array )
shape
length
1
<=
[
underlying
>array
]
[
shape
rest
:>
tail tail
product
:>
width shape
first
<iota>
[|
i |
i width
*
dup
width
+
underlying
subseq
tail
nest-shaped
]
map
]
if
;