News for hackers. Stuff that matters.
Re:Are dynamic languages going to replace static languages? ... by rphln on Wednesday August 04, 2021 @10:17AM (#28061254)
I don't know whether to feel disgusted or fascinated by this. I find the concept of prototype-based inheritance quite elegant, but this is a bit too much insane.
Re:Are dynamic languages going to replace static languages? ... by professoretc on Wednesday August 04, 2021 @04:06PM (#28065636)
There was an experimental language called Cecil that had "conditional inheritance". You could say things like

    class Rectangle:
        var w,h

    class Square(Rectangle if w == h):
        ...
You could then overload functions/methods on both `Square` and `Rectangle` and it would call the correct overload depending on the runtime values of `w` and `h`.