[racket] specifying types for fields in non-polymorphic structures

From: Alexander D. Knauth (alexander at knauth.org)
Date: Fri Apr 25 21:57:38 EDT 2014

But then the posn constructor doesn’t enforce that it’s arguments have to be Reals, and the posn? predicate doesn’t check it, and the accessors don’t say that they always produce Reals.  

On Apr 25, 2014, at 9:49 PM, David Van Horn <dvanhorn at cs.umd.edu> wrote:

> How about this?
> 
> (struct: (x y) posn ([x : x] [y : y]))
> (define-type Posn (posn Real Real))
> (define-type Origin (posn Zero Zero))
> 
> 



Posted on the users mailing list.