find-pred-loop ( ... i n seq quot: ( ... elt -- ... calc ? ) -- ... calc/f i/f elt/f )


Vocabulary
sequences.extras

Inputs
ian integer
nan integer
seqa sequence
quota quotation


Outputs
calc/fan object
i/fan integer or f
elt/fan object


Definition


: 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