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

walk needs more doc #16

Closed
miner opened this issue Dec 28, 2011 · 1 comment
Closed

walk needs more doc #16

miner opened this issue Dec 28, 2011 · 1 comment

Comments

@miner
Copy link
Contributor

miner commented Dec 28, 2011

I got tripped up by some changes to walk (compared to the pre-1.0 version). The order of the arguments changed, which is fine -- Clojure HOFs should take the function first. The big difference is that walk is now lazy and returns the results of mapping over the directory structure. The old version was called just for side-effects (per dorun). It's not obvious from the doc-string what the walk order is so it's unclear how useful the results would be.

I think walk should document the walk order as depth-first, and add a note that it's lazy. Suggested doc-string:

"Lazily walks depth-first over the directory structure starting at 'path', calling 'func' with three arguments [root dirs files]. Returns a sequence of the results."

Also, the doc-string for iter-dir should say that it's depth-first.

@Raynes
Copy link
Owner

Raynes commented Dec 28, 2011

Looks good. I'll accept a pull request fixing the docstrings, or I'll do it myself asap.

miner added a commit to miner/fs that referenced this issue Dec 28, 2011
@Raynes Raynes closed this as completed Dec 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants