[plt-scheme] field contracts?
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
> >
>