Handbook
Glossary
slice-til-either ( n string tokens -- n'/f string slice/f ch/f )
Vocabulary
modern
.
slices
Inputs
n
an
object
string
an
object
tokens
an
object
Outputs
n'/f
an
object
string
an
object
slice/f
an
object
ch/f
an
object
Definition
USING:
kernel
math
sequences
sequences.extras
;
IN:
modern.slices
::
slice-til-either
( n string tokens -- n'/f string slice/f ch/f )
n
[
n string
[
tokens
member?
]
find-from
dup
" \r\n"
member?
[
:>
( n' ch ) n' string n n' string
?<slice>
ch
]
[
[
dup
[
1
+
]
when
]
dip
:>
( n' ch ) n' string n n' string
?<slice>
ch
]
if
]
[
f
string
f
f
]
if
;
inline