[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] alternative name for `find-files'
From: |
Jim Ursetto |
Subject: |
Re: [Chicken-hackers] alternative name for `find-files' |
Date: |
Sun, 4 Jul 2010 09:54:07 -0500 |
I didn't do a survey of scheme systems like Peter, which makes me feel kind of
lazy now. directory-fold sounds like an adequate name. I was just going to
suggest a couple more names in case you do not want a compatible name like
directory-fold:
walk-filesystem, traverse-filesystem, filesystem-fold
The quotes around "Racket" were funny.
On Jul 4, 2010, at 5:47, Peter Bex <address@hidden> wrote:
> On Sun, Jul 04, 2010 at 11:45:19AM +0200, Peter Bex wrote:
>> That's a hard one. find-files is the perfect name for this procedure :(
>> Maybe DIRECTORY-FILTER, as it's like a (recursive) version of DIRECTORY
>> but with a filtered result set?
>
> I did a quick tour of the other major Schemes and was horrified to see
> how underpowered the bulk of them are; many schemes didn't even have
> such a procedure! I found the following:
>
> Gauche has DIRECTORY-FOLD which is similar (but with a lot less options)
> I like this better than DIRECTORY-FILTER because our FIND-FILES also
> accepts an optional folding procedure which defaults to CONS. If it were
> merely a filtering procedure it wouldn't allow that.
> Chibi also has DIRECTORY-FOLD.
>
> SCSH has FILE-MATCH, which is pretty different but like the docs say:
> "file-match provides a more powerful file-matching service, at the
> expense of a less convenient notation. It is intermediate in power
> between most shell matching machinery and recursive find(1)."
>
> "Racket" has FIND-FILES and FOLD-FILES. I don't like the naming
> convention. We have STRING-FOLD and VECTOR-FOLD, not FOLD-STRING and
> FOLD-VECTOR. But FILE-FIND and FILE-FOLD could be acceptable I guess.
>
> Guile has FTW, which is a horrible C-inspired name, but I think it
> stands for FILE-TREE-WALK which is an acceptable name. Alternatively,
> FILE-TREE-SEARCH (taken from the newer fts(3) POSIX interface).
> WALK could also be replaced by TRAVERSE.
>
> Of these, I really like DIRECTORY-FOLD most, and I think if we were to
> use it we should aim for compatibility with these two Schemes.
> I think this is possible. The signatures are
> (directory-fold path proc seed #!key lister follow-link?) for Gauche
> and (directory-fold dir kons knil) for Chibi.
> I think if Chicken has at least the same three initial positional
> arguments, the simplest usages of this procedure would be portable
> between these three Schemes. All other options could be keyword args,
> possibly overlapping with those of Gauche.
> Taylor Campbell also made a proposal that is equivalent to Chibi AFAICT:
> http://mumble.net/~campbell/proposals/filesys.text
>
> Cheers,
> Peter
> --
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
> is especially attractive, not only because it can be economically
> and scientifically rewarding, but also because it can be an aesthetic
> experience much like composing poetry or music."
> -- Donald Knuth
>
> _______________________________________________
> Chicken-hackers mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-hackers