Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add walkDirRecFilter recursive glob with follow filter (has full implementation) #261

Closed
timotheecour opened this issue Oct 9, 2020 · 1 comment
Labels

Comments

@timotheecour
Copy link
Member

timotheecour commented Oct 9, 2020

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 in os.walkDirRec): this can all be done in client code (unlike what's done in follow filter since it'd be "too late").
  • walkDirRec can be re-written by calling walkDirRecFilter (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 binary cmp proc); this could be done by doing a bit of refactoring by adding std/sorts so that os can import std/sorts and std/algorithm can import std/sorts, to avoid too much dependencies in std/os
  • alternative is to move walkDirRecFilter to a new module std/globs ; it might be better but that would prevent de-duping walkDirRec
  • 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 can import fusion/globs
@github-actions
Copy link

This RFC is stale because it has been open for 1095 days with no activity. Contribute a fix or comment on the issue, or it will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant