Number of return values of topological-sort Shiro Kawai (30 Jun 2024 07:50 UTC)
RE: Number of return values of topological-sort Maxime Devos (01 Jul 2024 09:06 UTC)
Re: Number of return values of topological-sort Marc Nieper-Wißkirchen (01 Jul 2024 12:15 UTC)
Re: Number of return values of topological-sort Lassi Kortela (01 Jul 2024 12:31 UTC)
Re: Number of return values of topological-sort Dr. Arne Babenhauserheide (01 Jul 2024 16:28 UTC)
Re: Number of return values of topological-sort Arthur A. Gleckler (02 Jul 2024 01:39 UTC)
Re: Number of return values of topological-sort Dr. Arne Babenhauserheide (02 Jul 2024 05:36 UTC)
Re: Number of return values of topological-sort Arthur A. Gleckler (01 Aug 2024 13:50 UTC)
RE: Number of return values of topological-sort Maxime Devos (01 Jul 2024 20:19 UTC)
Re: Number of return values of topological-sort Shiro Kawai (01 Jul 2024 16:14 UTC)
Re: Number of return values of topological-sort Dr. Arne Babenhauserheide (01 Jul 2024 19:33 UTC)
Re: Number of return values of topological-sort Shiro Kawai (01 Jul 2024 20:23 UTC)
Re: Number of return values of topological-sort Shiro Kawai (01 Jul 2024 20:26 UTC)
Re: Number of return values of topological-sort Dr. Arne Babenhauserheide (01 Jul 2024 22:35 UTC)
RE: Number of return values of topological-sort Maxime Devos (01 Jul 2024 20:19 UTC)
Re: Number of return values of topological-sort Shiro Kawai (01 Jul 2024 20:31 UTC)
Re: Number of return values of topological-sort Marc Nieper-Wißkirchen (01 Jul 2024 20:36 UTC)
RE: Number of return values of topological-sort Maxime Devos (01 Jul 2024 21:10 UTC)

Re: Number of return values of topological-sort Dr. Arne Babenhauserheide 01 Jul 2024 19:33 UTC
Shiro Kawai <xxxxxx@gmail.com> writes:

> On Sun, Jun 30, 2024 at 11:06 PM Maxime Devos <xxxxxx@telenet.be> wrote:
>
>  Optional return values work in Scheme too (e.g. consider call-with-values + case-lambda, ignore values you are not interested in). I
>
> The issue is that  if the API allows variable number of return values, you always need to handle it
> in the receiving side.

In all implementations I use, you can always ignore all values except
for the first by just using the return. Do you know ones that treat
multiple-values return differently?

(define deps (topological-sort ...)) ;; gets the first value

You have to explicitly request multiple values to see values two and
three.

(let-values (((res msg info) (topological-sort ...)))) ;; three values

That’s why I now changed the documentation to match the implementation:
always return three values.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de