Cor is an alternative OOP system for Perl

See the link for a comparison of Cor and Moose. Sample code:

classPoint {
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;
}
}

Source: linux.org.ru

Add a comment