ΠΠΎ ΡΡΡΠ»ΠΊΠ΅ ΡΡΠ°Π²Π½Π΅Π½ΠΈΠ΅ Cor ΠΈ Moose. ΠΡΠΈΠΌΠ΅Ρ ΠΊΠΎΠ΄Π°:
class Point {
has ( $x, $y ) :reader :writer :new :isa(Int);
method clear () {
( $x, $y ) = ( 0, 0 );
}
}
class Point3D isa Point {
has $z :reader :writer :new :isa(Int);
method clear () {
$self->next::method;
$z = 0;
}
}
ΠΡΡΠΎΡΠ½ΠΈΠΊ: linux.org.ru