There's no standard way to do it.
AFAIK r7rs-large plans to standardize this.
>>27
Overall I think your response is valid. I do think the admission of the last point alone is enough to condemn many potentially portable Scheme programs. A tricky thing to think about is that of course you could simply claim that you should never used unspecified behavior but this is operating under the assumption that we always know when we are doing. Even when you have a great deal of experience with a language you sometimes make mistakes, and if there no indication in your implementation, or even several major implementations that you made an error you are unlikely to fix it. This discourages portable software.
As far as I understand one location can only have one object.
Well yes, but the issue is what is a distinct object then I suppose for example eq? is unspecified for lists, numbers, strings, characters, vectors and functions. Another example might be equal? which is unspecified for functions.
Do you have any examples where this actually matters for mutually recursive definitions?
SICP has some.
It has five levels, from top to bottom: number, complex, real, rational and integer.
What about polar complex numbers and quaterions, what happens when you mix real numbers and polar complex numbers?
None of the standard ones have copy-on-write.
This is fair from the perspective of >>22 but it is still questionable to me, the only major implementation with copy-on-write is for strings, I know Gauche has them, and I wouldn't be surprised if there were others.
AFAIK r7rs-large plans to standardize this.
Really? That'd be a game changer honestly.