Cor แƒแƒ แƒ˜แƒก แƒแƒšแƒขแƒ”แƒ แƒœแƒแƒขแƒ˜แƒฃแƒšแƒ˜ OOP แƒกแƒ˜แƒกแƒขแƒ”แƒ›แƒ Perl-แƒ˜แƒกแƒ—แƒ•แƒ˜แƒก

ะŸะพ ััั‹ะปะบะต ัั€ะฐะฒะฝะตะฝะธะต 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

แƒแƒฎแƒแƒšแƒ˜ แƒ™แƒแƒ›แƒ”แƒœแƒขแƒแƒ แƒ˜แƒก แƒ“แƒแƒ›แƒแƒขแƒ”แƒ‘แƒ