Ko Cor tetahi punaha OOP rereke mo Perl

Tirohia te hono mo te whakataurite o Cor me Moose. Waehere tauira:

ira akomanga {
kua ($x, $y ) :kaipānui:kaituhi:hou:isa(Int);

tikanga marama() {
($x, $y ) = ( 0, 0 );
}
}

akomanga Point3D he Point {
he $z :kaipānui:kaituhi:hou:isa(Int);

tikanga marama() {
$self->next::method;
$z = 0;
}
}

Source: linux.org.ru

Tāpiri i te kōrero