Short summary: We need more tests and should ask ourselves if they make sense.
Discovering a bug in REJOIN motivated me to create some tests for it (it had none) and the outcome of that was I was quite surprised at how weird REJOIN's current behaviour is.
Though I have used REJOIN extensively in my R2 code, I must be using it in a way that avoids some behavioural ugliness.
Have a look at the tests added to Ren-c for REJOIN.
- Why is REJOIN so weird?
- Maybe I don't want to REJOIN in my code anymore if it is that odd.
- I only became aware of how weird it is by writing the tests.
- Tests serve as documentation and can therefore draw attention to weirdness perhaps motiving a better solution.
- I wonder if it would be useful to formalise the "tests as documentation" notion?