Cor - yon sistèm OOP altènatif pou Perl

Gade lyen an pou yon konparezon nan Cor ak Moose. Egzanp kòd:

Pwen klas {
gen ( $x, $y ): reader :writer :new :isa(Int);

metòd klè () {
($x, $y) = (0, 0);
}
}

klas Point3D se yon pwen {
gen $z :reader :writer :new :isa(Int);

metòd klè () {
$self->next::metòd;
$z = 0;
}
}

Sous: linux.org.ru

Add nouvo kòmantè