From 5471a32913a471f59e434a1021cc5b0785037a00 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 14 Jul 2006 14:49:59 +0000 Subject: [PATCH] use case-lambda instead of dot argument svn: r3703 --- collects/mzlib/file.ss | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/collects/mzlib/file.ss b/collects/mzlib/file.ss index a794743bde..ebd10ada6a 100644 --- a/collects/mzlib/file.ss +++ b/collects/mzlib/file.ss @@ -479,12 +479,16 @@ (cond [(and (not follow-links?) (link-exists? path)) (f path 'link acc)] [(directory-exists? path) (call-with-values (lambda () (f path 'dir acc)) - (lambda (acc . descend?) - (if (if (pair? descend?) (car descend?) #t) - (do-paths (map (lambda (p) (build-path path p)) - (directory-list path)) - acc) - acc)))] + (letrec ([descend + (case-lambda + [(acc) + (do-paths (map (lambda (p) (build-path path p)) + (sort + (directory-list path) void)) + acc)] + [(acc descend?) + (if descend? (descend acc) acc)])]) + descend))] [(file-exists? path) (f path 'file acc)] [(link-exists? path) (f path 'link acc)] ; dangling links [else (error 'fold-files "path disappeared: ~e" path)]))