Skip to content

Use roles instead of inheritance #5

@doy

Description

@doy

Right now, when a NetHack::Item is constructed, it parses the description and manually reblesses the instance into the appropriate class. This breaks subclassing, which makes extending NetHack::Item really hard (TAEB has to do a lot of weird reblessing of its own to work around this). If NetHack::Item just did a role application to $self instead, then $self could be any subclass too, and that would continue to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions