chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Multithreading test


From: Zbigniew
Subject: Re: [Chicken-users] Multithreading test
Date: Fri, 13 May 2005 20:00:00 -0500

On a related note, I was wondering how one typically handles the case
of a function that returns multiple values, but also needs to signal
failure.  I can think of a few ways:

1. Returning #f as one of the values, and testing for that;
2. out-of-band -- an exception or continuation to error handling code;
3. using (receive (values ...)) or equivalent call-with-values to get
a list or #f, just like if you had returned a list in the first place

It makes sense to throw some kind of exception, but this seems
exceedingly rare from what I've seen.  Returning #f is so much more
common.

On 5/9/05, felix winkelmann <address@hidden> wrote:
> In fact, some Schemes relax this somewhat (Chez Scheme, for example
> basically has Common-Lisp semantics, IIRC).
> Since this can get somewhat inconvenient, I will relax the rules as well:
> *implicit* non-multival continuations discard all but the first result value
> (so `(let ((foo (values 1 2 3))) ...)' will bind foo to 1..




reply via email to

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