Handbook
Glossary
selections-quot ( seq n quot -- seq quot' )
Vocabulary
math
.
combinatorics
.
private
Inputs
seq
an
object
n
an
object
quot
an
object
Outputs
seq
an
object
quot'
an
object
Definition
USING:
arrays
kernel
math
math.functions
sequences
;
IN:
math.combinatorics.private
::
selections-quot
( seq n quot -- seq quot' )
seq
length
:>
len n 0
<array>
:>
idx n
[
0
]
[
len
swap
^
]
if-zero
<iota>
[
drop
idx seq
nths-unsafe
quot
call
idx len
next-selection
]
;
inline