On 2008-07-26 16:07:49 Jamie Webb wrote:
> On 2008-07-25 08:14:31 Andrew O'Malley wrote:
> > Hi all,
> >
> > FYI, below is the implementation I use. You are free use it or
> > discard it as you see fit.
> >
> > I named it listRecursively to match the deleteRecursively method
> > already in FileExtras.
> >
> > However, that's pretty verbose for a commonly used function. How
> > about recurse?
> >
> > And I agree completely with Stepan that an Iterable approach is
> > better. You can then use it in for comprehensions such as:
> >
> > for (file <- "/Users/andrew".toFile.recurse if file.getName ==
> > ".svn") { ...
> > }
>
> Hi Andrew. This looks very useful. Do you mind sending me a CLA so
> that we can include it in the library?
>
>
http://scalax.scalaforge.org/cla-i.htmlI'm about to add this, but first a question about naming:
We've got two possibilities given here: 'listRecursively' and
'recurse'. However, IIRC Python calls this function 'walk', which I
quite like. In particular, 'recurse' seems a strange choice when in
fact we're unrolling the recursion by providing an iterator.
Any opinions?
/J