[plt-scheme] provide/contract

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Mon Oct 27 23:30:38 EDT 2008

Trying to learn about these enforced-contract things by adding  
"provide/contract" to some of my teachpacks.  For example,

(provide/contract (show-pinhole (-> image? image?))
                                (crop-top (-> image? number? image?))
                                (image-beside? (->* (image? image?)  
() #:rest (listof image?) image?)
                                ...)

Unfortunately, this doesn't pass a syntax check: as soon as there is  
even one (simple, like show-pinhole) provide/contract involving  
images, it says "unbound variable in module in: image?"  This is  
especially puzzling as I've been using image-library functions  
throughout the rest of the source file with no difficulty; it seems  
only provide/contract that can't find them.  I've already got
..
(require (lib "image.ss" "htdp"))
..
(provide (all-from (lib "image.ss" "htdp")))
..
What more do I have to do for provide/contract to know what an  
"image?" is?




Stephen Bloch
sbloch at adelphi.edu





Posted on the users mailing list.