We already have an opaque process object so I don't see a reason spawn can't return it as well.  Is there a platform
that's difficult to implement spawn to return it?
Making the spec weak to allow an implementation to return it can be a second choice; but I don't like spawn returns
different type of object depending on whether it waits for the process to exit or it runs the process asynchronously.
I thought it would be consistent that spawn returns a process object, from which the exit status can be retrieved (by wait).

On Sun, Jun 30, 2019 at 4:50 PM John Cowan <xxxxxx@ccil.org> wrote:

On Fri, Jun 28, 2019 at 10:24 PM Shiro Kawai <xxxxxx@gmail.com> wrote:

It appears that if you kick a subprocess using spawn()-family with spawn/nowait
or spawn/detach, there's no way to get the info of child process pid.  The spec
says they return unspecified exact integer.  Besides, on Windows you need
a process handle instead of pid (although this is POSIX srfi, swpan-procedures
do mention Windows).

Since the returned value is intrinsically not portable, I decided not to specify what it is, so I have weakened the return values in these cases from "unspecified exact integer" to "unspecified object".  Particular implementations may choose to return a process handle on Windows.

John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
It's the old, old story.  Droid meets droid.  Droid becomes chameleon.
Droid loses chameleon, chameleon becomes blob, droid gets blob back
again.  It's a classic tale.  --Kryten, Red Dwarf