Good points. I'm convinced.

On Tue, Dec 10, 2019 at 6:44 PM <xxxxxx@ancell-ent.com> wrote:
From: John Cowan <xxxxxx@ccil.org>
Date: Tuesday, December 10, 2019 4:41 PM

The non-generator interfaces are scsh legacy, and I'm happy for them to be removed if nobody objects.  It's obviously trivial to produce the generator over the scsh interface.

Generators rule!

I like directory-files because it's the dead simple API: directory path in, list of entries out (dot-files optional).  It is of course redundant with the generator interface, and would not be the end of the world to omit.

I'd like much stronger arguments before removing open-/read-/close-directory, because on a POSIX system you do have to wrap those system calls to create the friendlier interfaces, so the cost of exposing them is small, and I'm leary of forcing all users to use a generator, no matter how nice they are.

For example, use cases which don't require reading the entire directory: maybe you need to check for a few files and can stop after you find them, or only need to confirm it has at least N files.  close-directory only happens when the generator is exhausted, or, if you get the underpinnings correct, upon it getting gc-ed.

And my general philosophy is direct, albeit smartened up and safer direct POSIX wrappings are the explicit, official target of this SRFI, with convenience procedures like make-directory-files-generator as bonus conveniences.  Omitting open-/read-/close-directory would be a major departure, only comparable to not providing a full stty interface because that's a lot of work no longer relevant for most uses today, and using the magic of dynamic-wind avoids most causes that leave the terminal in a messed up non-echoing mode, requiring blindly entering "^Jreset^J".

- Harold

----- Original message -----