Handbook
Glossary
index-or-length ( seq n -- seq n' )
Vocabulary
sequences
Inputs
seq
a
sequence
n
an
integer
Outputs
seq
a
sequence
n'
an
integer
Word description
Returns the input sequence and its length or
n
, whichever is less.
Examples
USING: sequences kernel prettyprint ; "abcd" 3 index-or-length [ . ] bi@
"abcd" 3
Definition
USING:
kernel
math.order
;
IN:
sequences
:
index-or-length
( seq n -- seq n' )
over
length
min
;
inline