On Tuesday, September 20, 2016 at 7:41:23 PM UTC+5:30, Matthias Felleisen wrote:
> > On Sep 20, 2016, at 4:23 AM, Sourav Datta <soura.ja...@gmail.com> wrote:
> > 
> > Is it possible to import an untyped class into typed Racket? I know how to 
> > require for functions or structs but there seems to be no documentation 
> > about classes. Thanks!
> 
> 
> 
> That is the break-though of Asumu’s addition. Here is a simple example, 
> because I couldn’t find one in the docs: 
> 
> #lang racket
> 
> (module server racket
>   (provide C%)
> 
>   (define C%
>     (class object%
>       (init-field world)
>       (super-new)
>       (define/public (hello)
>         world))))
> 
> (module client typed/racket
>   (require/typed (submod ".." server)
>                  (C% (Class (init-field (world String)) (hello (-> String)))))
>   (send (new C% [world "good bye"]) hello))
> 
> (require 'client)

Awesome, thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to