[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] close-input-pipe return value
From: |
Zbigniew |
Subject: |
Re: [Chicken-users] close-input-pipe return value |
Date: |
Mon, 20 Jun 2005 13:56:25 -0500 |
On 6/20/05, Jörg F. Wittenberger <address@hidden> 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.