Check-exn Reference entry question

The check-exn entry of the rackunit section of the Reference contains the sentence

In the latter case, the exception raised must be an exn:fail?.
This confuses me because exn:fail? is a predicate, not an exception. I think the sentence should end with "must be an exn:fail." (or, less straightforwardly, "must satisfy exn:fail?.") Is that so?
1 Like

Yes, that sounds right to me. I would favor your second phrasing, "must satisfy exn:fail? ." Would you consider making a pull request to repair the documentation?

Let me know if I can help with this!

I thought it's "idiomatic" in Racket doc to use predicates like that.

Here are more examples:

  • "If local-dir-or-port is a path-string?" from 4 FTP: Client
  • "in that case, the value being checked in that case is a list?" from 4.17 Sets
  • "If all of its arguments are list-contract?s, then or/c returns a list-contract?." from ... (Discourse doesn't let me put more than two links. Hmm...)

These seem to indicate that the use of predicate there is intentional. So if we really are going to change it, we should change it consistently throughout the whole doc, not just that one occurrence.

4 Likes

Yes, I agree, consistency is good.

Side note: it's good to see you here, NNTR.

John, Sorawee, I agree with both of you. :slight_smile:

The use of predicates in these contexts is common in the documentation, but I think it's also a bit confusing, especially for Racket newcomers.

If I'm not mistaken, this is a new user limitation. I don't remember what the conditions are for getting this removed, but likely it will happen automatically rather soonish after some activity of yours. :slight_smile: