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

Shouldn't enumHOW get a "roles" method? #2156

Open
JJ opened this issue Jul 31, 2018 · 0 comments
Open

Shouldn't enumHOW get a "roles" method? #2156

JJ opened this issue Jul 31, 2018 · 0 comments

Comments

@JJ
Copy link
Collaborator

JJ commented Jul 31, 2018

The Problem

enums are built using the enumHOW protocol; that is why they, unlike those classes built using classHow, it does not have a roles method. However, an enum can have a single role (in fact, it does have a $!role).

Expected Behavior

For consistency and because it effectively has a role, it should be possible to use ^roles on enums.

JJ added a commit to Raku/doc that referenced this issue Aug 1, 2018
Along the way,

* [this question in
SO](https://stackoverflow.com/questions/51632394/assigning-a-value-to-the-attribute-of-a-mixed-in-role),
* Rakudo issue rakudo/rakudo#2165 on behavior of enumHOW
* Rakudo issue rakudo/rakudo#2156 on behavior of enumHOW again.
* A failed PR trying to change the behavior of Enumeration.

It is not complete, because some stuff would have to change in Rakudo
first, but it's there. So this closes #1555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants