chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] close-input-pipe return value


From: F. Wittenberger
Subject: Re: [Chicken-users] close-input-pipe return value
Date: Mon, 20 Jun 2005 20:37:13 +0200

Am Montag, den 20.06.2005, 11:51 -0500 schrieb Zbigniew:
> close-input-pipe discards the return value of the process you invoked,
> so you can't figure out if it failed.  It only signals an error (via
> exception) if the system call failed.
> 
> In Perl, close(pipe) will fail on a non-zero exit code (though the
> code is returned out of band, in $?).
> 
> 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, but where
> would you pass the code back?  Out-of-band variables, like in Perl,
> seem wrong in Scheme.

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?

> 
> Of course, with-input-from-pipe and friends would still not signal an
> error, this way.  I can live with that.  They could if an exception
> were signaled, or a procedure of your choosing were called upon
> close-input-pipe failure, but both seem a bit heavyweight.
> 
> I know PROCESS and PROCESS-WAIT can retrieve process codes, but I
> don't want to use them for various reasons.
> 
> Any suggestions?
> 
> Zb
> 
> 
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]