[plt-scheme] Difficulty with struct contracts in v299

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Mon Jan 24 20:56:23 EST 2005

Evening, all.

I'm having a slight problem with structure contracts in DrScheme
299.26-cvs9jan2005.  The module below demonstrates the problem:

    (module foo mzscheme

      (require (lib "contract.ss"))

      (define-struct (exn:cj:parse exn:fail:contract) (src))

      (provide/contract
       (struct (exn:cj:parse exn:fail:contract)
               ([message string?]
                [continuation-marks continuation-mark-set?]
                [src list?]))))

If I execute this in the module language, then I get the following error
message:

    expand: unbound variable in module in: exn:cj:parse-continuation-marks

It looks to me as though the contract system is interpreting my contract
as saying that the message field is inherited from the superstruct, and
the continuation-marks and src fields are declared in the new structure
type.  This is clearly not the case, though.

The docs for contract.ss don't seem to include any way for me to
indicate which fields are inherited and which fields are new.  Did I
overlook something, or can the contract library not handle this
situation?

Thanks,

Richard



Posted on the users mailing list.