Handbook
Glossary
find-number-escapes ( str -- set )
Vocabulary
escape-strings
Inputs
str
an
object
Outputs
set
an
object
Definition
USING:
ascii
combinators
kernel
math
sequences
sets
strings
;
IN:
escape-strings
:
find-number-escapes
( str -- set )
[
HS{
}
clone
SBUF" "
clone
0
]
dip
[
{
{
[
dup
93
=
]
[
drop
1
+
dup
2
=
[
drop
dup
>string
pick
adjoin
0
over
set-length
1
]
when
]
}
{
[
dup
digit?
]
[
[
dup
1
=
]
dip
[
over
push
]
curry
[
dip
]
curry
[
]
if
]
}
[
2drop
0
over
set-length
0
]
}
cond
]
each
0
>
[
[
>string
over
adjoin
]
unless-empty
]
[
drop
]
if
;