Handbook
Glossary
find-pred-loop ( ... i n seq quot: ( ... elt -- ... calc ? ) -- ... calc/f i/f elt/f )
Vocabulary
sequences
.
extras
Inputs
i
an
integer
n
an
integer
seq
a
sequence
quot
a
quotation
Outputs
calc/f
an
object
i/f
an
integer
or
f
elt/f
an
object
Definition
USING:
generalizations
kernel
math
shuffle
;
IN:
sequences.extras
:
find-pred-loop
( ... i n seq quot: ( ... elt -- ... calc ? ) -- ... calc/f i/f elt/f )
2pick
<
[
[
nipd
call
]
4keep
3 7 0
nrotated
[
[
3drop
]
2dip
rot
]
[
2drop
[
1
+
]
3dip
find-pred-loop
]
if
]
[
4drop
f
f
f
]
if
;
inline
recursive