Handbook
Glossary
paths-matching ( str -- seq )
Vocabulary
tools
.
completion
Inputs
str
an
object
Outputs
seq
an
object
Definition
USING:
assocs
combinators.short-circuit
io.files
io.files.info
io.pathnames
kernel
math
sequences
splitting
tools.completion.private
;
IN:
tools.completion
:
paths-matching
( str -- seq )
"P\""
?head
[
dup
last-path-separator
[
1
+
cut
]
[
drop
""
]
if
swap
dup
{
[
file-exists?
]
[
file-info
directory?
]
}
1&&
[
directory-paths
completions
]
[
2drop
{
}
]
if
]
dip
[
[
[
"P\""
prepend
]
dip
]
assoc-map
]
when
;