: ndip ( n -- )
[ [ dip ] curry ] swap call-n call ; inline
-: nrotates ( n depth -- quot )
- '[ _ [ _ nrot ] times ] call ; inline
+MACRO: nrotates ( n depth -- quot )
+ '[ [ _ nrot ] ] replicate concat ;
-: -nrotates ( n depth -- quot )
- '[ _ [ _ -nrot ] times ] call ; inline
+MACRO: -nrotates ( n depth -- quot )
+ '[ [ _ -nrot ] ] replicate concat ;
: ndrop ( n -- )
[ drop ] swap call-n ; inline
: find-pred-loop ( ... i n seq quot: ( ... elt -- ... calc ? ) -- ... calc/f i/f elt/f )
2pick < [
[ nipd call ] 4keep
- ! 3 7 nrotates ! stack checker does not like this
- 7 nrot 7 nrot 7 nrot
+ 3 7 nrotates
[ [ 3drop ] 2dip rot ]
[ 2drop [ 1 + ] 3dip find-pred-loop ] if
] [