Skip to content
Browse files

Merge commit 'upstream/master'

  • Loading branch information...
2 parents 5141895 + 3c32c3d commit 4c7011274899db5bb1a00870ed398868e072bd08 @Ivan64 committed Oct 1, 2011
Showing with 17 additions and 5 deletions.
  1. +17 −5 src/roles.pod
View
22 src/roles.pod
@@ -254,15 +254,27 @@ take precedence. This is the mechanism by which the C<AdminBot> class can
perform the appropriate C<on-message> method provided by both the
C<KarmaTracking> and the C<Oping> roles.
-When a class composes multiple roles, an alternate declaration syntax may be
-more readable:
+When a class composes multiple roles, an alternate declaration syntax -
+called an C<also> declarator - may be more readable:
=begin programlisting
class KarmaKeeper is IRCBot {
- does AnswerToAll;
- does KarmaTracking;
- does Oping;
+ also does AnswerToAll;
+ also does KarmaTracking;
+ also does Oping;
+ }
+
+=end programlisting
+
+The C<also> declarator is primarily intended for roles but can also be useful
+when creating anonymous classes or roles:
+
+=begin programlisting
+
+ my $karma = class {
+ also does KarmaTracking;
+ ...
}
=end programlisting

0 comments on commit 4c70112

Please sign in to comment.
Something went wrong with that request. Please try again.