Handbook
Glossary
glob-wildcard% ( root globs -- )
Vocabulary
globs
.
private
Inputs
root
an
object
globs
an
object
Outputs
None
Definition
USING:
accessors
arrays
combinators
combinators.short-circuit
io.files.info
io.pathnames
kernel
make
regexp
sequences
unicode
;
IN:
globs.private
::
glob-wildcard%
( root globs -- )
globs
?second
:>
next-glob next-glob
dup
pair?
[
second
]
[
drop
f
]
if
:>
next-glob-regexp root
glob-entries
[|
entry |
root entry
name>>
append-path
{
{
[
next-glob
not
]
[
dup
,
]
}
{
[
next-glob
empty?
]
[
entry
directory?
[
dup
,
]
when
]
}
[
next-glob-regexp
[
entry
name>>
>case-fold
next-glob-regexp
matches?
]
[
{
~quotation~ ~quotation~
}
0||
]
if
[
globs 2
tail
[
dup
,
]
[
entry
directory?
~quotation~ ~quotation~
if
]
if-empty
]
when
]
}
cond
{
[
entry
directory?
]
[
next-glob
]
}
0&&
[
globs
glob%
]
[
drop
]
if
]
each
;