Hi Axel,

On 2016-02-19 06:24:35 -0800, Axel Schnell wrote:
> I'm just experimenting with typed classes in the typed/racket language.In my
> first experiments I created a class called polynome% with a method derive.
> The result of this method is new instance of this class via (new this% ...).
> Unfortunately the drracket environment complained that it does not know
> this%. Is 'this%' missing by design or is it just not yet implemented?

It's missing by design, because it's unclear what type it can be assigned.

Typed Racket requires that a class type describes all of the methods/fields
that a class actually has, so that when you subclass it you can statically
check that no method/field name conflicts will occur.

But you can't write down such a type for `this%` because the methods/fields it
will have is only known at runtime. In particular, it may actually be a
subclass of the class you originally wrote the `this%` reference in.

Cheers,
Asumu

-- 
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