[racket] typed racket and interfaces

From: dfeltey at ccs.neu.edu (dfeltey at ccs.neu.edu)
Date: Fri May 2 21:24:37 EDT 2014

There is some documentation in the pre-release docs at 

http://www.cs.utah.edu/plt/snapshots/current/doc/ts-reference/Typed_Classes.html?q=Class

#:implements should be used inside of a Class type form.

The following is an example from the documentation:

> (define-type Point<%> (Class (field [x Real] [y Real])))
> (: colored-point% (Class #:implements Point<%>
                           (field [color String])))

I hope that clears things up a little bit.

Dan

----- Original Message -----
From: "Alexander D. Knauth" <alexander at knauth.org>
To: "Asumu Takikawa" <asumu at ccs.neu.edu>
Cc: "Racket Users" <users at racket-lang.org>
Sent: Friday, May 2, 2014 9:00:53 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket] typed racket and interfaces


On May 1, 2014, at 11:49 PM, Asumu Takikawa <asumu at ccs.neu.edu> wrote:

> On 2014-05-01 22:53:49 -0400, Alexander D. Knauth wrote:
>> Is there a way to specify inheritance in a class or interface type
>> constructor (so then you can avoid some copying and pasting)?
> 
> IIUC, your question is basically "why does #:implements in Class types
> not copy over initialization arguments?”.
I didn’t know about #:implements, and when I tried to use it, it gave me an error telling me that #:implements wasn’t a valid type, and the docs don’t say anything about it.  Is #:implements only in a later version (I have 6.0), or does it need to be used in a certain place, or what?  


____________________
  Racket Users list:
  http://lists.racket-lang.org/users


Posted on the users mailing list.