[plt-scheme] Dependent Contracts for Structures?

From: Will M Farr (farr at MIT.EDU)
Date: Tue Apr 7 11:23:23 EDT 2009

Hello all,

Is it possible to create "dependent" contracts (in the spirit of '->d)  
for structs in a provide/contract form?  I'm thinking something like

(struct matrix
   ((rows natural-number/c)
    (cols natural-number/c)
    (elts (vector-of-length/c (* rows cols)))))

When I try this now, I get that 'rows and 'cols are not bound in the  
(vector-of-length/c ...) contract. I don't see anything about this in  
the documentation for the (struct ...) form in (provide/contract ...).

It's not really strictly necessary, but it would be nice to have....

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: This is a digitally signed message part
URL: <http://lists.racket-lang.org/users/archive/attachments/20090407/46ec5b4e/attachment.sig>

Posted on the users mailing list.