[plt-scheme] detecting parameter types (contracts?)

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Thu Aug 30 10:21:12 EDT 2007

Is there a way to automatically detect paramater types of the
primative functions?  I'm guessing not, but perhaps the "contracts"
functions have something in them.  While this example is highly
contrived, I'll present a example to be clear on what i'm looking for:

(+ (if (equal? 'number (get-type-of-parameter-1 +))
       "nifty string")

or in english:
Given the function +, is there a way to automatically determine wether
i should be passing it a number, a symbol, or a string?


((lambda (y) (y y)) (lambda (y) (y y)))

Posted on the users mailing list.