Handbook
Glossary
filter-from! ( store from seq quot: ( ... elt -- ... ? ) -- seq )
Vocabulary
sequences
.
private
Inputs
store
an
object
from
an
object
seq
an
object
quot
a
quotation
with stack effect
( ... elt -- ... ? )
Outputs
seq
an
object
Definition
USING:
kernel
math
sequences
;
IN:
sequences.private
:
filter-from!
( store from seq quot: ( ... elt -- ... ? ) -- seq )
2over
length
<
[
[
[
move-unsafe*
]
dip
call
]
4keep
[
swap
[
1
+
]
when
]
3dip
[
1
+
]
2dip
filter-from!
]
[
drop
[
nip
set-length
]
keep
]
if
;
inline
recursive