[plt-scheme] raise-type-error for keyword argument

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Fri May 29 23:44:12 EDT 2009

The "raise-type-error" optionally accepts positional information for an 
argument that caused a type error.

Is there a way to do this for keyword arguments as well?

The best I have so far is to name the keyword in the "expected" argument 
to "raise-type-error":

(define (foo x y #:z (z 42))
  (or (integer? z)
      (raise-type-error 'foo
                        "integer for #:z"


Posted on the users mailing list.