n->th is exported from
racket/contract, and consequently by
racket. However, this function is not documented, and intentionally so (racket/base.rkt at e028f252da859759100f9248230bdc4e203a6684 · racket/racket · GitHub). To be more precise, it was unintentionally exported in the past, and my guess is that it was later decided that it's (somehow) too late to remove it from the export list.
This, of course, feels wrong to many people, including me. There seem to be three possibilities here:
- Leave it as it is
- Arguably, this function is useful and could be documented, but
racket/contractis definitely not the place for it. Perhaps move it to
racket/stringinstead? Perhaps need to check that inputs have correct types too (without using the contract library to avoid circular dependencies).
- Remove it from the export list. I don't see why doing so would cause trouble, since no one knows it exists anyway (well, this might become false after this thread is read).
What's the best option? Am I missing anything?
CCing @robby who commented that it's intentionally undocumented.