Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use roles instead of inheritance #5

Open
doy opened this issue Jul 6, 2013 · 0 comments
Open

Use roles instead of inheritance #5

doy opened this issue Jul 6, 2013 · 0 comments

Comments

@doy
Copy link
Member

doy commented Jul 6, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant