[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add "scandir" procedure
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Add "scandir" procedure |
Date: |
Thu, 01 Sep 2011 23:01:35 +0200 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) |
Hi,
Nala Ginrut <address@hidden> skribis:
> I don't mean 6 args is improper. But maybe some guys just want an easy
> thing, and maybe Guile newbies need a easy start with 'scandir'.
Oh, I just meant to say you could build ‘scandir’ (and others) atop
‘file-system-fold’.
The scandir(3) C function is really meant to be a higher-order function
but its interface is awkward and mixes different concerns (traversal and
filtering.) Using something akin to the ‘directory-contents’ procedure
I posted earlier, one could then use SRFI-1 to do actual filtering.
> 'scandir' is a POSIX function, so many people will think it exists in Guile.
> We have 'opendir' and 'readdir', but no 'scandir', that's strange.
Yes, you’re right. However, I feel that we can come up with something
both simpler and more expressive, as sketched above.
WDYT?
Thanks,
Ludo'.