Handbook
Glossary
max-monotonic-count ( seq quot: ( elt1 elt2 -- ? ) -- n )
Vocabulary
math
.
extras
Inputs
seq
an
object
quot
a
quotation
with stack effect
( elt1 elt2 -- ? )
Outputs
n
an
object
Definition
USING:
kernel
math
math.order
sequences
;
IN:
math.extras
:
max-monotonic-count
( seq quot: ( elt1 elt2 -- ? ) -- n )
over
empty?
[
2drop
0
]
[
[
0
swap
unclip-slice
swap
0
]
dip
[
[
swapd
]
]
dip
[
[
1
+
]
[
max
0
]
if
]
compose
compose
[
1check
]
curry
reduce
nip
max
]
if
;
inline