lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Sep 12, 2017 at 1:11 PM, Soni L. <fakedme@gmail.com> wrote:
> In fact you can't even dynamically (using reflection/code that's not aware
> of the traits/types) "DOWNcast" Foo into Trait! If you're not aware of Trait
> (if you don't explicitly check for Trait), then the compiler won't emit
> *any* code for Trait!

This is fair enough! All the type information is erased.

> You also can't add and remove traits at *runtime*. Among other things.

Ah, I see where your definitions come from - PoV dynamically typed
languages, where any value carries its full time around.

The nice thing about the static approach is that your surprises happen
when you're typing, not when you're running ;)