Unspecified result Lassi Kortela (07 Nov 2022 12:01 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 13:01 UTC)
Re: Unspecified result Lassi Kortela (07 Nov 2022 13:18 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 13:31 UTC)
Re: Unspecified result Lassi Kortela (07 Nov 2022 13:47 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 13:56 UTC)
Re: Unspecified result Lassi Kortela (07 Nov 2022 14:14 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 14:20 UTC)
Re: Unspecified result Lassi Kortela (07 Nov 2022 14:45 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 14:50 UTC)
Re: Unspecified result John Cowan (07 Nov 2022 14:45 UTC)
Re: Unspecified result Marc Nieper-Wißkirchen (07 Nov 2022 14:53 UTC)

Re: Unspecified result Marc Nieper-Wißkirchen 07 Nov 2022 13:56 UTC

Am Mo., 7. Nov. 2022 um 14:47 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:

> > I could add a recommendation of returning zero values.
>
> Sounds good.
>
> > Regarding program correctness and theoretical appeal, the best
> > resolution would be to equate "undefined returns" with "zero values".
> > Some code may break, but such code is probably buggy with a high
> > chance.
>
> Agreed. But see also https://docs.scheme.org/surveys/void-value/

We should not standardize such a value in a language with multiple values.

> It might be useful to have an (undefined) macro expanding to whichever
> value any given Scheme implementation uses for undefined values.
>
> The RnRS term "undefined" surely means the value can differ between
> different procedures returnig undefined results, and even between
> different invocations of the same procedure. But that seems like it's
> strictly a concession to the existing variety between implementations,
> and not something that makes for sound theory or a clean spec.

In some sense, it can make a sound theory.  Namely, when the number of
return values is undefined, something like

(let ([x (set! y 4)])
  ...)

would be a typing error because the assignment expression could return
not only one but also zero or more than one value.  Automated testing
tools could exploit this.

But always zero values would undoubtedly be better.