“Irritants”

I laughed when I first saw the arglist for R6RS's error:

(error who msg irritant1 ...)

There are irritants in the Scheme oyster, and error pearls them away for later reference. Cute!

“Irritant” is not a new term; it's existed in Scheme culture for a long time. The earliest reference I can find is in a Maclisp Scheme info file last modified in 1985, and it has turned up occasionally on the rrrs-authors mailing list. I haven't found it in any non-Scheme manuals (yet). Is it a Scheme-only term? Does anyone know where it originated?

For a while, the cuteness blinded me to a possible confusion: “irritants” suggests that the arguments should be the cause of the error — that they should be in some sense wrong or invalid. But they're only informative, and are often innocent indicators, not the causes of the irritation.

A format string and arguments is probably better, because it makes clearer messages. Or simply a string, in a language with string interpolation. Even though this doesn't call for a cute name.

3 comments:

  1. Actually that's the R7RS/SRFI-23 version. For whatever reason, the R6RS committee decided to go with "(error who message irritant ...)" where who represents the chief complainant. I proposed having both the SRFI 23 and the R6RS version under different names, but the WG voted to have just one.

    However, SRFI 23 uses the terms reason and args rather than message and irritants, which come directly from R6RS. SRFI 23 refers to SLIB's slib:error, which purports to treat all the arguments symmetrically.

    ReplyDelete
  2. Oops, I didn't notice the who argument (possibly because I saw SRFI 23 first). Fixed.

    ReplyDelete
  3. I'm hoping that WG2 will finally dispense with The Fortran Horror in favor of something gettext-ish for pure interpolation and localization, plus Alex Shinn's fmt library, which is based on combinators rather than a specialized string-based language — why, it even has Roman numeral support!

    ReplyDelete

It's OK to comment on old posts.