Polymorphism: Difference between revisions
m
→{{header|Raku}}: .perl not needed
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: .perl not needed) |
||
Line 3,857:
=={{header|Raku}}==
(formerly Perl 6)
{{
All appropriate constructors, initializers, accessors, and destructors are provided by default, but may be explicitly declared for flexibility.
To create only readonly accessors for better encapsulation, leave out all the "is rw" traits.
Line 3,864:
has Real $.x is rw = 0;
has Real $.y is rw = 0;
method Str { $
}
Line 3,870:
has Point $.p is rw = Point.new;
has Real $.r is rw = 0;
method Str { $
}
|