Handbook
Glossary
map-until ( seq quot: ( elt -- ? elt' ) -- seq' ? )
Vocabulary
successor
.
private
Inputs
seq
an
object
quot
a
quotation
with stack effect
( elt -- ? elt' )
Outputs
seq'
an
object
?
an
object
Definition
USING:
kernel
math
sequences
;
IN:
successor.private
:
map-until
( seq quot: ( elt -- ? elt' ) -- seq' ? )
[
t
0
pick
length
[
[
2dup
]
]
dip
[
<
and
]
curry
compose
]
dip
[
[
over
]
]
dip
[
change-nth
]
curry
compose
[
[
nip
]
]
dip
[
keep
1
+
]
curry
compose
while
drop
;
inline