Skip to content

Conversation

skx
Copy link
Owner

@skx skx commented Oct 16, 2022

Sample usage looks like this:

(directory:walk "/etc" (lambda (x)
                         (if (directory? x)
                             (print "Got directory: %s" x)
                           (print "Got file: %s" x)
                           )))

To avoid the complexity of adding this as a built-in form the implementation creates "directory:entries" to return the contents of the given path, recursively.

If we have a list of file/directories, and a function, we can just use apply to do the magic.

This closes #34.

skx added 3 commits October 16, 2022 09:21
Sample usage looks like this:

```
(directory:walk "/etc" (lambda (x)
                         (if (directory? x)
                             (print "Got directory: %s" x)
                           (print "Got file: %s" x)
                           )))
```

To avoid the complexity of adding this as a built-in form the
implementation creates "directory:entries" to return the contents
of the given path, recursively.

If we have a list of file/directories, and a function, we can just
use apply to do the magic.

This closes #34.
@skx skx merged commit b4f41b5 into master Oct 16, 2022
@skx skx deleted the 34-directory-walk branch October 16, 2022 06:31
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

Successfully merging this pull request may close these issues.

Implement directory:walk
1 participant