[plt-scheme] field contracts?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sat Oct 9 10:54:06 EDT 2004

Here's one way to do that:

(module m mzscheme
  (provide/contract
    (struct posn ((x number?) (y number?))))

  (define-struct posn (x y)))

Robby

At Sat,  9 Oct 2004 01:06:14 -0700 (PDT), Michael Vanier wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> 
> Quick question:
> 
> Is there a reasonably straightforward way to define a struct or object type
> whose fields are required to be of specific types?  It seems like the
> contract system should be usable for this, but I don't see any examples in
> the PLT scheme documentation.
> 
> Mike


Posted on the users mailing list.