[plt-scheme] field contracts?

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Sat Oct 9 10:31:26 EDT 2004

You may also be happy with provide/contract:

(module point mzscheme
  (define-struct posn (x y))
  (provide/contract
    (struct posn ((x number?) (y number?))))
  )

-mike

On Sat, Oct 09, 2004 at 09:44:23AM -0400, Matthias Felleisen wrote:
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Look for
> 
>  13.4??Attaching Contracts to Values
> 
> in Help Desk's contracts m anual -- Matthias
> 
> On Oct 9, 2004, at 4:06 AM, 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.