Polymorphism: Difference between revisions

m
→‎{{header|Raku}}: .perl not needed
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: .perl not needed)
Line 3,857:
=={{header|Raku}}==
(formerly Perl 6)
{{Worksworks with|rakudoRakudo|2015-11-302020.08.1}}
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 { $.perl }
}
 
Line 3,870:
has Point $.p is rw = Point.new;
has Real $.r is rw = 0;
method Str { $.perl }
}
 
2,392

edits