guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

find


From: Michael Burschik
Subject: find
Date: Thu, 2 May 2002 11:07:01 +0200

The guile ideas page lists an implementation of the find utility accepting
multiple procedures as a worthwile objective. But is it really?

As far as I understand the proposal, this would only be a shorthand for a
special case in which one wanted to apply several predicates and actions to
matching filenames, i.e.

(find directory (glob ".deps") directory? print-filename)

would be the same as

(find directory
  (lambda (filename)
    (and (glob ".deps" filename)
         (directory? filename)
         (print-filename filename))))

While the first version is certainly shorter, it is not necessarily clearer.

But things usually get more complicated. One frequently requires some kind
of comparison, such as

(< 30 (mtime filename))

or even a combination of various negated or combined predicates, such as

(and (not (owner "root" filename))
     (or (glob ".tmp" filename)
         (glob "*~" filename)
         (> (atime filename) 3)))

that are not so readily simplified, unless I am unable to see the simple
solution.

So what this would boil down to is a lot of syntactic sugar for the most
uninteresting special case the procedure might be used for. This isn't what
scheme is all about, or is it?

Regards

Michael Burschik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]