[racket] TR base-env typing classes/instances

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu Nov 8 13:10:30 EST 2012

On Wed, Nov 7, 2012 at 4:02 PM, Ray Racine <ray.racine at gmail.com> wrote:
> Given racket/place/distributed then the typing should go into base-env.rkt
> true?
> Assuming so, we face the situation that the place/distributed API uses class
> instances.
>
> e.g. spawn-node-supervise-place-at returns (values remote-node%
> remote-connection%)
>
> I know how to do it a la collects/types/mred but I couldn't spot an example
> of class/instance typing in directly in base-env.rkt's DSL typing syntax.

Here's a quick untested example:

(make-Class
  (list -Integer) ;; positional init args
  (list (list 'x -Symbol)) ;; named init args
  (list (list 'm (-> -String -String)))) ;; methods

then (make-Instance some-class-type) is the type of an instance.

--
sam th
samth at ccs.neu.edu

Posted on the users mailing list.