Cor ist ein alternatives OOP-System für Perl

Hier ist ein Vergleich von Cor und Moose. Codebeispiel:

classPoint {
hat ( $x, $y ) :reader :writer :new :isa(Int);

Methode klar() {
( $x, $y ) = ( 0, 0 );
}
}

Klasse Point3D isa Point {
hat $z :reader :writer :new :isa(Int);

Methode klar() {
$self->next::method;
$z = 0;
}
}

Source: linux.org.ru

Kommentar hinzufügen