On Wed, Dec 11, 2019 at 1:03 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
 
- As mentioned, it's significantly higher-level than the other stuff in
this SRFI.

In what sense?  It's glob(3) and much like other things at that level.
 
- It's easy to implement in portable Scheme on top of a directory walker.

The implementation on top of open/read/closedir is certainly not a trivial effort; especially if you want to minimize the number of directories you open.  There's no reason not to use the libc implementation since it is there.
 
- Not sure interpreter speed is the bottleneck even on slow
interpreters; is interpretation really slower than syscalls and disk I/O?

Good point.
 
It'- Probably not implemented in C on Windows API. Windows FindFirstFile()
has its own weird glob syntax that we need to deliberately avoid in any
case.

 It's not available in Win32, that's true; but lots of Posix things aren't.  Here's a self-described minimal implementation:  https://github.com/oetiker/rrdtool-1.x/blob/master/win32/win32-glob.c


- There is no agreement on a particular glob syntax. In particular, "**"
globs are useful but not as standard. How are international characters
handled? Etc.

Posix 2008 and later specifies *, ?, and [...] only, and that's what we should provide too.
 
- It'd be nice to use S-expression regexps instead of using string
regexps and worrying about escaping. Probably would be nice to have the
traditional string regexps as well.

The whole point of this function is to trade off perfomance, certainly in scsh, for convenience.  It does what it does.
 
Not much opinion on those particular options; errors should probably be
on by default.

Makes sense.  Change the argument name to carry-on? then.
 
We also need to support musl libc and the like. Do those have glob()?

Anything that supports Posix 2008 has glob().  In particular both musl and newlib have it.



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
The peculiar excellence of comedy is its excellent fooling, and Aristophanes's
claim to immortality is based upon one title only: he was a master maker
of comedy, he could fool excellently.  Here Gilbert stands side by side
with him.  He, too, could write the most admirable nonsense.  There has
never been better fooling than his, and a comparison with him carries
nothing derogatory to the great Athenian. --Edith Hamilton, The Greek Way