Skip to content

Commit b9a8e1d

Browse files
authored
Merge pull request #3048 from gdonald/roles-is-or-does
Roles can also be mixed in using 'is'.
2 parents bec6bdb + 06afd51 commit b9a8e1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

doc/Language/objects.pod6

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,13 @@ and code reuse within objects.
742742
743743
X<|does>
744744
Roles use the keyword C<role> preceding the name of the role that is
745-
declared. Roles are mixed in using the C<does> keyword preceding the name
746-
of the role that is mixed in.
745+
declared. Roles are mixed in using the C<does> keyword preceding the name of
746+
the role that is mixed in.
747+
748+
Roles can also be mixed into a class using C<is>. However, the semantics of
749+
C<is> with a role are quite different from those offered by C<does>. With C<is>,
750+
a class is punned from the role, and then inherited from. Thus, there is no
751+
flattening composition, and none of the safeties which C<does> provides.
747752
748753
=begin code
749754
constant ⲧ = " " xx 4; #Just a ⲧab

0 commit comments

Comments
 (0)