>> As an example of this behavior, I point to the following Racket program: >> >> #lang racket >> >> (define foo >> (with-output-to-string >> (lambda () >> (system* (find-executable-path "ls") "/tmp")))) > > I agree that it would be nice to make this work as you expected. In > order to handle ports that are not simply raw POSIX file descriptors > (e.g. string ports), we'd need to create a pipe behind the scenes, and > arrange for thread(s) in the current process to copy data between the > pipe(s) and the Scheme port. > > I'd like to do this at some point, although for the sake of backward > compatibility we'd probably have to leave 'system' and 'system*' as-is > and create a new API that works more intuitively.
If you do, may I suggest taking a look at Racket's Processes? I'm not aware of things like "custodian" or "synchromizable event" in Guile, but I've used Racket's Processes successfully in the past.