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/

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.

Reply via email to