Skip to content

Commit b88200e

Browse files
committed
Adds section on traits for subs
1 parent 426890b commit b88200e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/Language/traits.pod6

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ say don't-instantiate.imm for ^10;
6363
6464
Uninstantiable classes can still be used via their class variables and methods, as above. However, trying to instantiate them this way: C<my $do-instantiate = don't-instantiate.new;> will yield the error C<You cannot create an instance of this type (don't-instantiate)>.
6565
66+
=head2 Traits and routines
67+
68+
Traits can be added to the definition of methods and routines to establish L<precedence|/functions#Precedence> and L<associativity|/language/functions#Associativity>. They act as a
69+
L<sub defined using C<trait_mod>|/type/Sub#Traits> which take as argument the types and names of the traits that are going to be added.
6670
6771
=end pod
6872

0 commit comments

Comments
 (0)