Handbook
Glossary
(product-find) ( ... ns sequences k quot: ( ... seq -- ... ? ) -- ... ? )
Vocabulary
sequences
.
product
.
private
Inputs
ns
an
object
sequences
an
object
k
an
object
quot
a
quotation
with stack effect
( ... seq -- ... ? )
Outputs
?
an
object
Definition
USING:
kernel
math
sequences
sequences.private
;
IN:
sequences.product.private
::
(product-find)
( ... ns sequences k quot: ( ... seq -- ... ? ) -- ... ? )
k sequences
length
1
-
=
:>
done? k sequences
nth-unsafe
[
k ns
set-nth-unsafe
ns done? quot
[
sequences k 1
+
quot
(product-find)
]
if
]
find
drop
;
inline
recursive