Skip to content

Conversation

gdonald
Copy link
Member

@gdonald gdonald commented Oct 8, 2019

The problem

The docs say a Role can be mixed into a class using "does" but fails to mention that "is" also works.

Solution provided

Update the docs to clarify how "is" also works to mix a Role into a class.

@jnthn
Copy link
Contributor

jnthn commented Oct 8, 2019

The semantics of is with a role are quite different from those offered by does. With is, a class is punned from the role, and then inherited from. Thus, there is no flattening composition, and none of the safeties it provides.

@gdonald
Copy link
Member Author

gdonald commented Oct 8, 2019

Thank you for the comment. Relying heavily on your explanation I updated my PR to explain the difference a bit more.

@lizmat
Copy link
Collaborator

lizmat commented Oct 8, 2019

s/none of the safeties C provides./none of the safeties which C provides./

??

@JJ JJ merged commit b9a8e1d into Raku:master Oct 9, 2019
@gdonald gdonald deleted the roles-is-or-does branch October 9, 2019 12:18
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

Successfully merging this pull request may close these issues.

4 participants