Skip to content

Types that are subtypes of more than one other type? #33

Description

@staypufd

From the docs it seems that new types can only be subtypes of one parent. This seems to be limit that is not actually required as your creating a more dynamic system that allows for redefinition at runtime, etc.

Having multiple parents also allows for greater locality of function for the multimethod interface definitions as you would have the parents implementing their interfaces that are then available to the subtype that inherits from the two parents. It would be similar to mixins and allow the mixin to be specific for the behavior it provides as both an interface and default implementations that can then be overridden in the subtype. For example:
A Log class and a Human class, which Male and Female subclasses. The Log class provides generic logging and defines an interface that has warn, error, info methods, and default implementations for each that just print out the type of the class.

Male and Female each subclass from Human as well as Log. Human can also have an interface that it defines that has a say method with a default implementation. Male and Female can override this to print their own specific output.

Anyway, thanks for considering this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions