-
Notifications
You must be signed in to change notification settings - Fork 23
Closed as not planned
Closed as not planned
Copy link
Labels
Description
proposal
I wrote this lib/std/private/globs.nim
some time ago for use in kochdocs; this RFC is to move it to stdlib inside os.nim or a new std/globs.nim
design rationale
- only a follow filter is needed; user code can without loss of generality filter the iterator output so we don't need a
yieldFilter
(as done in pkg/glob (/cc @citycide see http://bolingen.me/glob/latest/glob.html) or even a selection for pcFile, pcDir etc (as done inos.walkDirRec
): this can all be done in client code (unlike what's done infollow
filter since it'd be "too late"). walkDirRec
can be re-written by callingwalkDirRecFilter
(and could be deprecated maybe)
discussion
- better names welcome; maybe
s/walkDirRecFilter/glob
? - in future work I want to allow adding a
sortBy = cmp
(by a user defined unary or binarycmp
proc); this could be done by doing a bit of refactoring by adding std/sorts so that os canimport std/sorts
and std/algorithm canimport std/sorts
, to avoid too much dependencies in std/os - alternative is to move
walkDirRecFilter
to a new modulestd/globs
; it might be better but that would prevent de-dupingwalkDirRec
- it could be moved to
fusion/globs
but that requires accepting RFC: fusion should be importable by compiler sources, and even stdlib and koch fusion#22 so that kochdocs canimport fusion/globs
treeform and ZoomRmc