modern.slices: Add peek-from

modern-harvey3
Doug Coleman 2019-12-01 09:45:23 -06:00
parent 1cf3e1161d
commit 73f2838c87
1 changed files with 3 additions and 0 deletions

View File

@ -134,3 +134,6 @@ ERROR: subseq-expected-but-got-eof string n expected ;
] [
nip [ [ length ] bi@ - ] keepd swap
] if ; inline
: peek-from ( string n count -- string n slice )
[ drop ] [ drop ] [ + ] 2tri reach ?<slice> ;