take-n ( sequence-parser n -- seq/f )


Vocabulary
sequences.parser

Inputs
sequence-parsera sequence-parser
nan integer


Outputs
seq/fa sequence or f


Definition


:: take-n ( sequence-parser n -- seq/f )
n sequence-parser [ n>> + ] [ sequence>> length ] bi >
[ sequence-parser take-rest ] [
sequence-parser n>> dup n +
sequence-parser sequence>> subseq sequence-parser
[ n + ] change-n drop
] if ;