On 6/20/05, Jörg F. Wittenberger <[EMAIL PROTECTED]> wrote:
> Am Montag, den 20.06.2005, 11:51 -0500 schrieb Zbigniew:

> > An easy fix is to have close-input-pipe return the value from pclose()
> > (stored in the variable "r"), since it currently returns nothing at
> > all.  Semantically it makes sense to return #f on failure

> Why not just return the error code?  OK, that's at odds with returning
> #f on failure.  If you _want_ the latter, why not return multiple
> values?

The reason to return #f is so close-input-pipe behaves as a predicate.
 That doesn't work if you return multiple values, nor does it work if
you return an integer.

I am not opposed to a return code there, though.  It is easy to do 
(if (zero? (close-input-pipe p))
     'success 'failure)

but I thought felix might have another suggestion (or reason to leave
it as is).  Or possibly a really great idea that would even catch
non-zero return codes in with-input-from-pipe etc.


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to