Handbook
Glossary
count-tail ( seq quot -- n )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
quot
a
quotation
Outputs
n
an
integer
Word description
Count the number of values from the end of
seq
that return a truthy value when passed into
quot
.
Definition
USING:
kernel
math
sequences
;
IN:
sequences.extras
:
count-tail
( seq quot -- n )
[
not
]
compose
[
find-last
drop
]
keepd
length
swap
[
-
1
-
]
when*
;
inline