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 Lassi Kortela 01 Jul 2024 12:31 UTC

Shiro:

> Does topological-sort always return 3 values?  I'm not sure because the second and third paragraph of the topological-sort entry seems to allow it to return either 1 or 3 values.
>
> I prefer not to have that choice; if it returns 3 values, all implementations should return 3 values.  If that's the intention, we can state "It returns three values.  The first value is the list of topologically sorted nodes or #f ..." to be clear.

+1

Shiro:

> "Optional return values" works in CL, where excessive return values are silently ignored, but that's not the case in Scheme.

Maxime:

>     I sometimes find a variable number of return values to be
>     convenient, but it’s very situation-dependent. (I’m not familiar
>     enough with this situation in particular.)

I'm not aware of any Lisp dialect where returning a different number of
values from the same procedure is considered idiomatic.

When different callers bind a different number of values, that's
idiomatic in CL. But all expressions in the CL spec return a predictable
number of values.

Marc:

> There is still a difference to CL because you have to use one of the few
> keywords/procedures for multiple values in Scheme, while you would be
> able to use an analogous procedure in CL wherever a single value is
> expected.
>
> In any case, returning a varying number of values seems very
> non-idiomatic for typical Scheme code/APIs.

+1